Reading line-by-line on a socket

sik0fewl xxdigitalhellxx at hotmail.com
Thu Mar 13 15:59:14 EST 2003


Hey,

Is there any way to read line by line on a socket, without having to 
recv() a chunk and the keep it in some sort of queue to retrieve later?

The reason this doesn't work for me is because I would like select() to 
still be able to detect that there is data waiting to be read from the 
socket. If all else fails I'll just have to do a loop through the 
incoming queue after my socket has data to be read.

In short, I want a readline() for a socket.

Any suggestions?

-- 
Thanks,
Ryan





More information about the Python-list mailing list