On Behalf Of Stephen Ware:
# server = TCPServer.new('127.0.0.1', 5056)
                         ^^^^^^^^^^
                         loopback address

# I can connect from the same machine using telnet ..
# cannot connect from any remote machines.

loopback address is not accessible remotely

try using address of your network card.. (eg i tried mine at 10.2.10.123 and it works..)

kind regards -botp