Tamás Michelberger
Secret Sauce Partners, Inc.
:tmichel!~tmichel@example.com PRIVMSG ##budapestrb :some message\r\n
require "socket" sock = TCPSocket.new(host, port) while message = sock.gets puts message end sock.close
gets
read
read_nonblock + IO.select
read*
Timeout.timeout(5) do # Do something with a socket # and now you have a race condition # on your hands end
More: Timeout: Ruby's Most Dangerous API
sspinc.workable.com
Setting a Socket Connection Timeout in Ruby
By Tamás Michelberger
Building a simple IRC bot in Ruby.
Building software even when it's an overkill