0

I found TooTallNate's Java-Websocket library. I am attempting to implement a client and server as a proof of concept to see if web sockets will solve a problem for us.

My client is my Ubuntu 12.04 Linux workstation. I wrote a websocket server application that listens for bindings on 4242. Then I run my client and attempt to connect. I captured the communication using wireshark:

214 9.064163    192.168.1.81    192.168.20.50   TCP 74  43413 > 4242 [SYN] Seq=0 Win=14600 Len=0 MSS=1460 SACK_PERM=1 TSval=185839 TSecr=0 WS=128
215 9.064191    192.168.20.50   192.168.1.81    TCP 54  4242 > 43413 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0

My question is, why would the packet be refused so quickly? I don't believe I'm running a firewall, but if it were a firewall, unregistered ports generally just get ignored instead of shutdown within a few picoseconds. Does anyone know what this means?

Steve Rukuts
  • 9,167
  • 3
  • 50
  • 72
Thom
  • 14,013
  • 25
  • 105
  • 185
  • 1
    does `netstat -l` indicate that the server is actually listening? – fvu Dec 30 '13 at 13:13
  • @fvu Doh! I don't think so. Great question. Let me look into this. – Thom Dec 30 '13 at 13:14
  • Well, if there's nothing listening on that port according to netstat, your server isn't actually listening, which would explain your issue. – fvu Dec 30 '13 at 13:17
  • @fvu Yep, that was it. Please post as an answer so I can mark as such. I was not calling start() on my server. – Thom Dec 30 '13 at 13:29

1 Answers1

1

You should first of all check whether the server is actually listening, using netstat:

netstat -ln

or, using the long form parameters

netstat --listening --numeric

If you don't see anything listing on the correct port, something went wrong during setup on the server side.

fvu
  • 32,488
  • 6
  • 61
  • 79