Solved

compile error

Posted on 2004-09-21
9
196 Views
Last Modified: 2010-08-05
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
Comment
Question by:xenia27
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
  • 2
9 Comments
 
LVL 12

Accepted Solution

by:
Giant2 earned 200 total points
ID: 12120059
isClosed method is from jdk 1.4.
Probably you are using a jdk less than 1.4.
0
 

Author Comment

by:xenia27
ID: 12120061
so if I wanna determinate whether the socket is still connected, how can I do so?
0
 
LVL 12

Expert Comment

by:Giant2
ID: 12120068
what kind of jdk are you using?
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

Author Comment

by:xenia27
ID: 12120072
I'm using 1.3...is there any way I can determinate the connection of my socket?
0
 
LVL 12

Expert Comment

by:Giant2
ID: 12120083
0
 
LVL 18

Assisted Solution

by:armoghan
armoghan earned 100 total points
ID: 12120091
isConnected is supported by all sockets
isBound is not be supported by all sockets
see the documentation of  bind (SocketAddress bindpoint)
          throws IOException
0
 
LVL 12

Assisted Solution

by:Giant2
Giant2 earned 200 total points
ID: 12120117
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
 
LVL 12

Expert Comment

by:Giant2
ID: 12120939
Thanks.
:)
0
 
LVL 18

Expert Comment

by:armoghan
ID: 12121012
Thanks.
:)
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question