0
I have an application that is running and listening for local requests on port 4001. Whenever I start a second application to place requests through port 4001 my mac appears to be automatically forwarding the request to a different port. For example, when I check t see what processes are running on port 4001 prior to launching the second application I get:
Grants-MacBook-Pro:sbin grantseward$ sudo lsof -i -n -P | grep 4001
Password:
java 113 grantseward 52u IPv6 0x3465d3725017ec8d 0t0 TCP *:4001 (LISTEN)
But as soon as I launch the second app it appears to originally send requests to port 4001 but then they get routed to 49509 and that port is closed / not what my other app is listening to (the second port also changes each time I stop and start the second app so I can't simply change where I am listening).
Grants-MacBook-Pro:sbin grantseward$ sudo lsof -i -n -P | grep 4001
java 113 grantseward 52u IPv6 0x3465d3725017ec8d 0t0 TCP *:4001 (LISTEN)
java 113 grantseward 59u IPv6 0x3465d3725f0a988d 0t0 TCP 127.0.0.1:4001->127.0.0.1:49505 (CLOSE_WAIT)
java 121 grantseward 80u IPv6 0x3465d3726032d38d 0t0 TCP 127.0.0.1:49506->127.0.0.1:4001 (ESTABLISHED)
Any ideas how I can change the rules to have requests sent to 4001 end up at 4001?
Thanks, this indirectly helped me find the root cause.. It turns out there was a socket being opened that was never closed which prevented me from making the connection I wanted. – user416988 – 2015-02-10T02:33:42.890