Solved

compile error

Posted on 2004-09-21
9
193 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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 scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
The viewer will learn how to implement Singleton Design Pattern in Java.

809 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