mania mir wrote:
Alvin Parker wrote:BTW, it looks like you've got a ServerSocket running at 10502 and a Socket running at port 10501. You have another ServerSocket running at 10500. Where is your server running at port 10501?
Yes, two server sockets are running,
1) Control Server at port 10500, I have no problem in getting result from this server it returns "done#1#end#done#2#end#done#3#end#done#4#end#done#5#end"
2) Transfer Server at port 10502, the socket exception occurs at the time of reading result from Transfer server - line 103.
Client Socket is running at localhost/10501 :
And thanks for your exampleI'm trying to figure out how I should solve this exception.
Alvin Parker wrote:BTW, it looks like you've got a ServerSocket running at 10502 and a Socket running at port 10501. You have another ServerSocket running at 10500. Where is your server running at port 10501?
Alvin Parker wrote:Have you looked at isClosed() or isConnected() from the API? I don't ever use those methods as my read stream tells me what I need to know and catching sudden disconnects will fail gracefully. But to just get the connection established and see where it is failing these methods may help you : Javadoc Sockets
Alvin Parker wrote:isBound() does not report on whether a Connection is alive or not. The socket binds to ports, not connections. You want to use another method to check...
Alvin Parker wrote:I see where you've got that socket running on several different ports and this one is failing on 10502. What does your client socket that is binding to that port look like? Your connection was reset (see first line of stack trace). That can be because you closed the connection.
Alvin Parker wrote:If you're getting socket exception there, is it possible your Connection is closed?
Alvin Parker wrote:Your stack trace is pointing to line 216 of TransferServer as the first point it has a problem. What's going on at that point in your code?