This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

server_socket.setSoTimeout() issue going from NT to XP

 
Ryan Steel
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
does anyone have any idea why this is happening? Should I be posting in an expert forum instead?
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ryan Steel
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe in WNT the exception thrown was InterruptedIOException. Or Maybe the clients connected before the 5 sec expired.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic