[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Concerning listen() and shutdown()



ajf@afco.demon.co.uk (Alan Fry) writes:
>Firstly, it seems that while the dialogue with the server is going on,
>MacPerl cannot continue to 'listen()', so there seems to be no point in
>setting a 'queuesize' more than 1 for 'listen(SOCKET, QUEUESIZE)'. Is that
>so?

Not really.

>Is it possible to 'listen()' and so something else at the same time
>with MacPerl

Yes. After you have called listen, you can call the 4-argument variant of
select on that socket. If the socket is ready for reading, a connection is
pending.

>Secondly, having entered the listen() state, how can one get out of it if,

Just closing the socket should suffice.

>Thirdly, if I may go on very briefly, in the case of shutdown(SOCKET, HOW),
>what in the MacPerl context is HOW?

Same as on other platforms

     If how is 0, then further receives will be disallowed.  If  how
     is  1,  then further sends will be disallowed.  If how is 2,
     then further sends and receives will be disallowed.

Matthias

-----
Matthias Neeracher   <neeri@iis.ee.ethz.ch>   http://www.iis.ee.ethz.ch/~neeri
  "If people are boasting that they use the best tools, you can figure that 
   they can't find any competitive advantage to using those tools, or else
   they wouldn't be presenting them as a competitive advantage." -- Dave Winer