From: Ed W Date: 2005-03-27T18:14:46+09:00 Subject: Re: Asyn sockets >>Presumably then I won't find out the success of failure of the >>socket open until some later time when the async open completes? > > > WRT your ruby code, the Socket#connect call won't return until either > it is successful or failed. > > What I meant above is: the ruby vm will not be blocked just because > you do a Socket#connect in blocking mode. The ruby vm will be able to > schedule other threads to run while it waits for the success/failure > of the connect syscall. Aha. Well in that case I would call this a "blocking" connect. The point is that I know have to start to use a bunch of threads to do simple stuff like opening some sockets. In my perl code it's admitedly a complete bear to get it working in async mode under win32, but once it's done I now have just one thread and an io:select kernel which spins round and round scheduling stuff to run. None of the individual operations are expected to take any significant time so I don't need the timeslicing ability of adding these ops to seperate threads/processes. Is there a place to propose an addition to the API, like adding a "blocking" attribute to the socket library? Seems that this could be a very useful addition for a (small?) number of people? Anyway, haven't written anything yet, but I love the look of Ruby. Will schedule some smaller projects to be written in it for kicks Thanks for your answers Ed W