Solved

compile error

Posted on 2004-09-21
9
198 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

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 This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
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:
Suggested Courses

624 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