I try to listen a specific port on server. I write a simple console app but I get error:
Only one usage of each socket address (protocol/network address/port) is normally permitted.
However, I don't find any process to listening that port. Resource manager and CurrPorts don't show any information.
My code (all code):
var ipEndPoint = new IPEndPoint(IPAddress.Any, 7001);
var tcpListener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
tcpListener.Bind(ipEndPoint);
tcpListener.Listen(100);
My questions are:
- How can I find which process listen the port? Currports doesn't show, also resmon too.
- Why node.js is listen the port and getting messages? What is different?
- I think I have a hidden thread but I doesn't find it. I use ProcessExplorer.
Update:
When I run my console app after server reset, it is working correctly. However, when close and re-open the app, it is not working and given that exception above.