From: nobu.nokada@... Date: 2002-12-19T12:43:39+09:00 Subject: Re: Socket problem Hi, At Thu, 19 Dec 2002 11:53:24 +0900, Child wrote: > I'm trying to write a NNTP client and I encountered some problems with > sockets. I have to read server response from socket. The response is > multiline and ends with ".\r\n". Is there any way to get whole response > at once? At the moment I use gets and read the response line by line, > which is horribly inefficient. In C program I used ioctl FIONREAD call > to read number of available bytes and then fetched them with read, but > can't get this call working in ruby - always get "Bad address > (Errno::EFAULT" error. And if I use recv with arbitrary number (eg. > 10000) it hangs forever. socket.gets("\r\n.\r\n") -- Nobu Nakada