Solved

compile error

Posted on 2004-09-21
9
192 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
  • 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This video teaches viewers about errors in exception handling.

776 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