Re: [ntdev] Process ID from filename under VS 6

New development for windows 2000? I doubt that you will get a lot of help

That beings said, the question makes no sense. Try to rephrase it and likely you will find a solution without and help

Sent from Surface Pro

From: xxxxx@gmail.com
Sent: ‎Tuesday‎, ‎July‎ ‎28‎, ‎2015 ‎5‎:‎14‎ ‎PM
To: Windows System Software Devs Interest List

A co-worker just asked me how to get a Process ID from a filename using Visual Studio 6 under Windows 2000. If it’s not clear, this is not a driver question.

Thanks for any help. I will see if I can find the answer, but if anyone knows the answer please let me know for him.

Paul


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

When you say client and server I assume that your mean the process that calls accept is the server and connect is the client (or the equivalent functions)

If that is the case, then it is easy to detect that the server has gone away when a socket connection uses the loopback adapter (local communication) because you will get errors from socket operations. I don’t know what IO model you are using (select, synch IO, IOCP etc.) but any of them can detect this. Even if these errors are not the result of a disconnect, you probably still need to reconnect because you won’t have reliable data. When this happens, presumably you can attempt to reconnect the socket. If that fails, keep retrying until you succeed because the server process may not have restarted completely when you detect the disconnect

Sent from Surface Pro

From: xxxxx@gmail.com
Sent: ‎Wednesday‎, ‎July‎ ‎29‎, ‎2015 ‎1‎:‎35‎ ‎PM
To: Windows System Software Devs Interest List

I just asked David, my co-worker, some follow up questions.

It is embeddedXP, not 2000. This is on custom hardware on a locomotive somewhere in the world. We work on data gathering for railway customers. We make the locomotive’s black boxes, which are actually orange.

David has written a client which communicates with a server on the same machine via sockets. Every time the client receives a message from the server, he resets a ten second watchdog timer. The traffic between the client & server is heavy. If the watchdog timer asserts, it is fair to say that the server has crashed, restarted and has a new listening socket, which the client is not aware of. The debugger shows that the new server has a new PID. The only thing my co-worker knows about the server is that it is C:\somedir\servername.exe. The customer wants David to look into getting the PID for servername.exe while connected and compare it with the PID for servername.exe after the watchdog timer asserts. If they are different, I am not sure what he plans to do, but he will know that the server crashed and his original connection is lost.

We have no control of the server and no access to source. We can’t tweak the server or have it do anything to help us. We can only communicate via sockets.

David asked me as he was late walking out the door, so I did not get a lot of details last night.

Thanks.
Paul


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer