From: ts Date: 2003-09-29T21:41:37+09:00 Subject: Re: Ruby Newbie's Question: Sockets - searching for equivalent to a perl programme >>>>> "J" == Johannes Steigerwald writes: J> irb(main):029:0* t=TCPSocket.new('localhost',8530) J> # J> irb(main):030:0> t.addr J> ["AF_INET", 61501, "127.0.0.1", "127.0.0.1"] J> irb(main):031:0> t.peeraddr J> ["AF_INET", 8530, "127.0.0.1", "127.0.0.1"] J> irb(main):032:0> t.puts("#$(netutl-client-msg-header J> netutl-client-msg-type/gui-blocking \"Perl client\")\r\n") J> nil well, the difference with the perl program is perhaps here J> select(SOCK); J> $|=1; J> select(STDOUT); it force a flush after every print, try to add t.sync = true svg% ri IO#sync= --------------------------------------------------------------- IO#sync= ios.sync = aBoolean -> aBoolean ------------------------------------------------------------------------ Sets the ``sync mode'' to true or false. When sync mode is true, all output is immediately flushed to the underlying operating system and is not buffered internally. Returns the new state. f = File.new("testfile") f.sync = true svg% p.s.: you use 1.6.8, no ? Guy Decoux