Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • 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
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

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