From: Tanaka Akira Date: 2002-12-19T14:04:14+09:00 Subject: Re: Socket problem In article <200212190449.gBJ4nBb24264@sharui.nakada.kanuma.tochigi.jp>, nobu.nokada@softhome.net writes: > Hmm, then read the status response at first, and read the text > response if present, according to the protocol. I expected following case. C> list active comp.lang.r* S> 215 Newsgroups in form "group high low flags". S> comp.lang.rexx 0000037710 0000037671 y S> . C> list active comp.lang.ru* S> 215 Newsgroups in form "group high low flags". S> . (Note that comp.lang.ruby is not exist in our news server.) The client reads text response after status line. The status line is "215 ... .\r\n". So, socket.gets("\r\n.\r\n") works on "list active comp.lang.r*" but not on "list active comp.lang.ru*". Because the text response with terminator is only ".\r\n" which is not terminated by "\r\n.\r\n". > Fetching available data is possible with io/wait extension > library, but I don't guess it's reliable to determin the end of > input. I think ungetc can solve the problem by unget "\r\n" before reading a text response. But stdio doesn't support more than one byte with ungetc. -- Tanaka Akira