Amitabh Shukla wrote: > Greetings > > I need to get the process name that is using an open port on Windows > and Unix programatically in C. On unix I think the best way may be > read the /proc fs.(I would be glad to know of a better/more portable > way.) I don't know how to obtain that information on Windows. > Please help me with some pointers on how to go about it. > > Thanks, > AS
Hmm...not sure about *NIX, but the simplest way would be to capture the output of 'netstat -o' under Windows (Win2000 and later) and then parse it. 'netstat' exists for *NIX, but I don't know if it maps open sockets to process IDs. That would be the most portable (albeit "hacky") method. http://forum.sysinternals.com/forum_posts.asp?TID=12532 -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* MyTaskFocus 1.1 Get on task. Stay on task. http://www.CubicleSoft.com/MyTaskFocus/
