I have developed a c# application using TcpClient/TcpListener to listen for requests from other applications on the local machine. Now I need to determine what process is actually making the connection to my listener.
There are some examples out there using GetExtendedTcpTable to see what processes are using which ports. But it seems like that would be a very expensive operation to run on EVERY connection to my listener. The system has to know who is making the connection, right? I just can't find the information exposed through any of the objects. Any winsock gurus out there willing to lend a hand?