Hi,

I'm sorry about the mistake, this is a typo. Please refer to the following 
code:

irb(main):018:0> t = TCPSocket.new('127.0.0.1', 110)
=> #<TCPSocket:0x2b28320>
irb(main):019:0> t.readline
=> "+OK POP3 Server Ready\r\n"
irb(main):020:0> t.send("USER xrfang / 172.18.2.1\n", 0)
=> 23
irb(main):021:0> t.readline
=> "+OK\r\n"
irb(main):022:0> t.send("PASS xrfang\n", 0)
=> 19
irb(main):023:0> t.readline
=> "+OK\r\n"
irb(main):024:0> t.send("STAT\n", 0)
=> 5
irb(main):025:0> t.readline
=> "+OK 5 10631\r\n"
irb(main):026:0> t.send("RETR 1", 0)
=> 6
irb(main):027:0> t.readline

After the final readline, it hang up again. I don't know the exact 
difference between t.readline and t.recv, but they both hang.

Thanks,
Shannon

>From: ts <decoux / moulon.inra.fr>
>Reply-To: ruby-talk / ruby-lang.org
>To: ruby-talk / ruby-lang.org (ruby-talk ML)
>CC: ruby-talk / ruby-lang.org
>Subject: Re: socket emergency
>Date: Wed, 20 Aug 2003 22:18:20 +0900
>
> >>>>> "X" == Xiangrong Fang <xrfang / hotmail.com> writes:
>
>X> irb(main):007:0> t.send('USER xrfang / 172.18.2.1\r\n', 0)
>X> => 26
>
>  Be carefull with '' and \r \n
>
>svg% ruby
>p 'aa\r\n'.size
>p "aa\r\n".size
>^D
>6
>4
>svg%
>
>  try to use
>
>
>       t.send("USER xrfang / 172.18.2.1\r\n", 0)
>
>
>Guy Decoux
>
>

_________________________________________________________________
Tired of 56k? Get a FREE BT Broadband connection 
http://www.msn.co.uk/specials/btbroadband