my dog learned polymorphism
The moose likes Sockets and Internet Protocols and the fly likes Handling a TCP reset 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 "Handling a TCP reset" Watch "Handling a TCP reset" New topic

Handling a TCP reset

Thomas Emerst

Joined: Dec 26, 2010
Posts: 7

The project consists of a server and a client. The client is at-first, sending data to the server. In-turn, the server replies - it is essential for the client to wait and acquire the server's reply after each call.
My issue is fairly odd: my client, while awaiting for the server's response (in a while{} loop), stalls and never seizes to execute. Upon some investigation, Wireshark unvealed that the server is sending a TCP-reset (RST) message back to my client, but the program doesn't seem to pick that up and throw an exception or an error.

The client gets stuck at the while(this.bis.ready() == false) {} loop, since the server isn't sending any data, it's terminating with a TCP-reset message, but the program continues to run, no exception is thrown. How can I detect the connection-reset?

Thank you.

[Thumbnail for stall.PNG]

siharvey Harvey

Joined: May 16, 2012
Posts: 1

We are currently facing exactly the same problem you described below. We appear to successfully send a request but timeout waiting for a response. Using Wireshark we can see that an RST message is being sent back from the server but no exception is raised in our application.

Did you find an answer to your original question?

Thank you.
I agree. Here's the link:
subject: Handling a TCP reset
It's not a secret anymore!