title: Is it possible to get the thread Id of a process that is listening to a Port in Windows?
body: <p>In windows we can list the ports that are currently used and the process that are listening to it using the <em>netstat</em> command. Just wondering if it is possible to find the exact thread id that opened the port inside the process?</p>
  
  <p>I am looking for programmatic solutions like open process, IPC, etx. In windows if I inject a dll to the process I can get all the windows messages, however it does not include port related events. </p>