compile error

Hi,


I try to use "isClosed" and "isConnected" but I got this error message...
"Method isClosed() not found in java.net.Socket"

Any idea what's wrong???

Also, I would like to know what's the different between "isBind" and "isConnect"??


Xenia
xenia27Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Giant2Connect With a Mentor Commented:
isClosed method is from jdk 1.4.
Probably you are using a jdk less than 1.4.
0
 
xenia27Author Commented:
so if I wanna determinate whether the socket is still connected, how can I do so?
0
 
Giant2Commented:
what kind of jdk are you using?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
xenia27Author Commented:
I'm using 1.3...is there any way I can determinate the connection of my socket?
0
 
armoghanConnect With a Mentor Commented:
isConnected is supported by all sockets
isBound is not be supported by all sockets
see the documentation of  bind (SocketAddress bindpoint)
          throws IOException
0
 
Giant2Connect With a Mentor Commented:
another system (JDK 1.3) to detect if socket is closed is to try to send/receive something. If an exception raised up, then the socket is closed.
0
 
Giant2Commented:
Thanks.
:)
0
 
armoghanCommented:
Thanks.
:)
0
All Courses

From novice to tech pro — start learning today.