Re: ctrl + c
joe_at_invalid.address
Date: 09/30/05
- Next message: Simon Elliott: "Re: non-blocking sockets: poll() or select()?"
- Previous message: Pascal Bourguignon: "Re: encoding sting in UNIX environment using Windows codepage 1252..?"
- In reply to: rishi.shah_at_patni.com: "ctrl + c"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 30 Sep 2005 09:42:43 -0500
"rishi.shah@patni.com" <rishi.shah@patni.com> writes:
> I am developing a project in unix/c++ in which I have the server
> process that has invoked several client processes on different
> machines. To terminate the server process the user will press ctrl +
> c. Now when ctrl + c is pressed, I want to signal the client
> processes to terminate as well.
If the clients are listening to the connection they will see it's been
closed when the server exits. You can define that as telling them to
exit as well.
> Now here I have the doubts. When I press ctrl+c does the server
> process get a chance to process further instructions or is it killed
> immediately?
If you catch it, no.
> Is there is some way in which I can delay the killing
> process so that I can signal the clients to terminate? The client
> and server have TCP connection established so I am planning to send
> the signal on the TCP connection. I cannot kill the client
> processes since I have not forked the processes but invoked them
> using exec client(.exe) on a separate machine.
The connection being dropped is probably all the signal you need for
that.
Joe
-- It was impossible to get a conversation going; everybody was talking too much. - Yogi Berra
- Next message: Simon Elliott: "Re: non-blocking sockets: poll() or select()?"
- Previous message: Pascal Bourguignon: "Re: encoding sting in UNIX environment using Windows codepage 1252..?"
- In reply to: rishi.shah_at_patni.com: "ctrl + c"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|