From: "Mauricio Fernández" Date: 2003-03-03T02:31:52+09:00 Subject: Re: Unable to do non-blocking read on socket On Mon, Mar 03, 2003 at 02:04:21AM +0900, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: Unable to do non-blocking read on socket" > on 03/03/03, Seth Kurtzberg writes: > > |Also, the blocking behavior only occurs when the maximum read size argument is > |supplied to the read() call. > > IO#read without maximum size is supposed to read _all_ data from the > port, so that it should naturally block. What would be the way to read all the data currently available, without blocking (waiting for more)? The only solution I can thing of without using #sysread is using select and reading only one byte at a time, then repeating until there's nothing left, but this is so sloow... -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com Steal my cash, car and TV - but leave the computer! -- Soenke Lange