Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

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
0
xenia27
Asked:
xenia27
  • 5
  • 2
  • 2
3 Solutions
 
Giant2Commented:
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
xenia27Author Commented:
I'm using 1.3...is there any way I can determinate the connection of my socket?
0
 
armoghanCommented:
isConnected is supported by all sockets
isBound is not be supported by all sockets
see the documentation of  bind (SocketAddress¬†bindpoint)
          throws IOException
0
 
Giant2Commented:
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now