Solved

compile error

Posted on 2004-09-21
9
190 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
 

Author Comment

by:xenia27
ID: 12120072
I'm using 1.3...is there any way I can determinate the connection of my socket?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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 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…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now