Add-Ons & Services

HttpServer issuing TCP [RST,ACK], then Crashes

Please post support and help requests here.
Posts: 5
Joined: 22 Feb 2013, 16:46

HttpServer issuing TCP [RST,ACK], then Crashes

Postby bmeads » 05 Mar 2013, 21:45

I am working on an inherited project that is using the POCO::Net HttpServer based on the httpserver architecture in the documentation.
I have disabled TLS so I can analyze the traffic using wireshark.

Client server communications are in JSON format. Basically the client asks for information and the server retrieves it from various sources and returns it to the client on request.

The server starts up fine and listens on port 8080 for new http requests. after a while, the Server crashes. seems to depend on the wireless network. sometimes it happens immediately, sometimes it takes 25 or so tries to get the error.

I am using WireShark filtered for port 8080 packets to look at the traffic. Whats happening is that the Server is responding to a client request with a TCP protocol RST,ACK when it crashes.
These are always accompanied by checksum errors in the same packet. There are other checksum errors in the traffic, but it always stops on the RST, ACK packet. (I am not a TCP expert).

sample packet info (TCP Stream) (.82 is client, .90 is server):
"467","310.481856000","","","TCP","78","57585 > http-alt [SYN] Seq=0 Win=65535 Len=0 MSS=1460 WS=16 TSval=319122069 TSecr=0 SACK_PERM=1"
"471","310.485107000","","","TCP","66","57585 > http-alt [ACK] Seq=1 Ack=1 Win=131760 Len=0 TSval=319122122 TSecr=141379"
"478","310.495625000","","","HTTP","301","GET /fetch.ashx?mode=live&type=info&poi=3 HTTP/1.1 "
"481","310.498432000","","","TCP","199","[TCP segment of a reassembled PDU]"
"484","310.501558000","","","TCP","66","57585 > http-alt [ACK] Seq=236 Ack=134 Win=131632 Len=0 TSval=319122136 TSecr=141381"
"485","310.506025000","","","TCP","804","[TCP segment of a reassembled PDU]"
"486","310.508897000","","","TCP","66","57585 > http-alt [ACK] Seq=236 Ack=872 Win=130896 Len=0 TSval=319122144 TSecr=141381"
"489","310.900721000","","","TCP","54","http-alt > 57585 [RST, ACK] Seq=872 Ack=236 Win=0 Len=0"

My assumption is the server is crashing due to the unhandled exception of the socket being reset. I dont know why the socket is being reset.
Problem is I don't know how to catch these exceptions so I can handle them.

I have tried to find a way to create an error handler or use ConnectionResetException for the socket so I can hopefully catch the condition and handle it appropriately, but I havent found out how to attach an error handler to the socket.

what is the correct way to catch and handle this error? Is there a code sample of attaching an error handler to the socket?

Any advice would be greatly appreciated!!

Return to “Support”

Who is online

Users browsing this forum: No registered users and 1 guest