in reply to Not blocking on a socket connect

It is unclear to me if you are listening to the port, or attempting to connect to one.

As a listening process, you can use fork() to launch child processes to handle individual connections. This is described well in O'Reilly's Advanced Perl Programming (p. 193 - Handling Multiple Clients).

In the same chapter, the authors go on to describe multiplexing using Select. This is useful if you are waiting on any one of a set of connections to occur, and then handle appropriately.

Can you provide more detail on why you don't want to wait on a connection? Is spawning of a child process not acceptable for some reason?

Replies are listed 'Best First'.
RE: RE: Not blocking on a socket connect
by Adonnai (Initiate) on May 27, 2000 at 01:37 UTC
    Sorry for the ambiguity...
    I want to make a connection to a remote host with me being the client. The problem is that I need to handle other tasks while I wait for the connection to occur (i.e. create socket, initiate connection, do something else, check connection status). I don't want to be stuck waiting for connect() to return. I know I could fork to do concurrent stuff but I'm just curious as to if it's possible.
      Yeh yeh, I also need to know this exact thing .... please answer, I'm well stuck! Cheers, -Be