0

I have an application which listens to port(8087). There is a client process which give request to this server and server will send response message back. After some requests and response, my client process is not able to connect to that port.

I could see a port listening when i used netstat tool. Also my process is running.

# netstat -a | grep 8087
tcp        0      0 0.0.0.0:8087            0.0.0.0:*               LISTEN

But i am not able to connect to that port from a client. What could be the reason for this?

A R
  • 2,697
  • 3
  • 21
  • 38
  • Experience shows that this is almost always firewall-related. – Tom Aug 20 '14 at 06:03
  • How can it be firewall related if i was able to do some exchanges initially? – A R Aug 20 '14 at 06:08
  • I don't know, but turn off your firewall and try it again; if you still have the problem, I'll be convinced it's not firewall related. The Windows firewall has bitten me too many times – Tom Aug 20 '14 at 06:23
  • Use `strace` on the server. Google for `SO_REUSEADDR` – Basile Starynkevitch Aug 20 '14 at 06:33
  • Based on the information, all you can say is that the reason is probably a bug in the server. All you need to do is find it and fix it. – molbdnilo Aug 20 '14 at 07:51
  • Is there any way to debug this if it is an issue in server? – A R Aug 20 '14 at 08:02
  • "my client process is not able to connect to that port" the specific error is what? You can paste part key codes here. – Charlie Aug 20 '14 at 08:48

1 Answers1

0

Try the following steps

  1. On the server machines run the command "iptables -nL" to see which policies are set. If firewall rules are set, delete the rules and try connecting again.

  2. Run following tcpdump command on the server machine

    tcdump -nnvX -s0 -iem1 host client_machine_ip and port 8087

    and following tcpdump command on the client machine

    tcdump -nnvX -s0 -iem1 host server_machine_ip and port 8087

    This will tell you if client machine is sending packet out and server machine is receiving it.

  3. Run the command "netstat -ans" on server machine and under the IP and TCP labels, see if any packets are getting dropped.

  4. Check in /var/log/messages on server machine if any errors are getting reported.

Hope this helps.

Vimal
  • 436
  • 1
  • 4
  • 14