2

I have a Python 3 websocket server, it works fine with nodejs client wscat:

%> wscat -n -c ws://192.168.154.200:11111
connected (press CTRL+C to quit)
< Received PING
< Received PING
> your message

When I try to build another client with WebSocket4Net, it kept closing the client socket with 1011 error (every 20~30s):

enter image description here

In the mean while, python server with another error code 1006:

code = 1006 (connection closed abnormally [internal]), no reason

It's totally weird, I started to look for relevant code in Websocket4Net. But I never find anything useful, only a enum to Unexpected Error, and it seems to be never used.

Any ideas?

daisy
  • 22,498
  • 29
  • 129
  • 265
  • The FIN indicates the tCP closed. The http uses the TCP for the transport layer. Just a wild guess. You may have more than one PC with the same IP address. I would disconnect the ethenet cable form one machine and then use ping to see if you get a response. Then repeat in other direction. TCP tries 3 times (at 5 seconds apart) waiting for the ack before closing. You can see if the repeat is occurring if you see more than one packet with same sequence number. – jdweng Sep 13 '19 at 15:00
  • I've updated the wireshark screenshot. It's three virtual machines and I don't have duplicated IP address ... – daisy Sep 13 '19 at 15:15
  • I can't tell if the if there a retries on the ping because the sequence number for the 2nd to last ping is off the top of the screen. The pings are 5 seconds apart which probably means it is a retry. So it looks like your are getting data from the far end, responding properly, but the return path is open between the machine you are working at and the far end. I've seen this before. It is either hardware issue or the mask on the machine at the far end is not in the network. Crazy routing loop. On far end machine cmd.exe >IPCONFIG/ALL to get mask. The mask may be wrong. Sniffer far end. – jdweng Sep 13 '19 at 15:50

0 Answers0