Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2000-09

Timing out a syscall?

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mike Ravkin

What's the proper way to time out a socket connect function, or another syscall? Putting it in a thread and then terminating the thread after X seconds leaves zombie processes, wich are not good.

Reply by email

Unknown author
What's the proper way to time out a socket connect function, or another syscall? Putting it in a thread and then terminating the thread after X seconds leaves zombie processes, wich are not good.

use select() to check if there is data before reading data from the socket.

Reply by email

Mike Ravkin
to Unknown author

That works fine after the connect(), but connect() itself is blocking, and can take as long as it feels like.. this is obviously bad.

Earlier message 23 lines
----- Original Message ----- From: To: Sent: Wednesday, September 20, 2000 2:51 AM Subject: Re: [fpc-devel]Timing out a syscall? > > What's the proper way to time out a socket connect function, or another > > syscall? Putting it in a thread and then terminating the thread after X > > seconds leaves zombie processes, wich are not good. > > > > use select() to check if there is data before reading data from the socket. > > > > > > _______________________________________________ > fpc-devel maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-devel >

Reply by email