GeeCON Prague 2014*
The moose likes Sockets and Internet Protocols and the fly likes server_socket.setSoTimeout() issue going from NT to XP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "server_socket.setSoTimeout() issue going from NT to XP" Watch "server_socket.setSoTimeout() issue going from NT to XP" New topic
Author

server_socket.setSoTimeout() issue going from NT to XP

Ryan Steel
Greenhorn

Joined: Apr 16, 2004
Posts: 3
Hello
a program that used to run on Windows NT is now being run on WindowsXP pro.
95% of the time it runs as it did before. However, sometimes it is keeps throwing an error:
P10CAPProcess:Connecting to Client iioe: ...

Is there something possibly going on in windows XP interanlly causing this? It appears if I change server_socket.setSoTimeout(5000) to server_socket.setSoTimeout(0) it seems to stop the error.
Can someone tell me why this happening as I am new to java and socket stuff

Ryan Steel
Greenhorn

Joined: Apr 16, 2004
Posts: 3
does anyone have any idea why this is happening? Should I be posting in an expert forum instead?
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
Welcome to the Ranch Ryan.
InterruptedIOException is the superclass of SocketTimeoutException. The latter will be thrown if accept does not receive a connection in 5 seconds. Try catching such exception instead of its superclass to be sure what it is happening. If SocketTimeoutException is effectively thrown try setting a longer period for the mentioned socket option.


SCJP2. Please Indent your code using UBB Code
Ryan Steel
Greenhorn

Joined: Apr 16, 2004
Posts: 3
thanks so much for your reply.
I have increased the time to 60 seconds and it appears to be working but I am confused about catching the error without the superclass like you said. why did this not happen on NT before??
thanks again!
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
Maybe in WNT the exception thrown was InterruptedIOException. Or Maybe the clients connected before the 5 sec expired.
 
GeeCON Prague 2014
 
subject: server_socket.setSoTimeout() issue going from NT to XP