From: Dominik Werder Date: 2003-05-16T17:14:17+09:00 Subject: Re: TCP Sockets >> How can I tell how many bytes can be read from an IO object without >> blocking? > It's not possible to do exactly that, but you can set the socket to > non-blocking IO. Then, when you call socket.read and socket.write, they > won't block, and will return how much they actually read and wrote. > You'll need to use select so you only write when there's space, > otherwise you'd have a loop. > > You probably want to use threads instead. Internally, all the IO seems > to be asynchronous, but using non-blocking IO may not work well, and I > haven't found out how to do it on Windows. What are you trying to do? Thanks! Perhaps it would be cool for my better understanding to know why actually the IO operations are blocking?? I tried to make a simple debugging tool to simulate a simple HTTP request and dump all to my screen. I thought it would be a twoliner but then the blocking issues appeared.. :(( thanks! Dominik