Tcp socket connection from ruby on rails

need urgent help on how to connect my ROR web app to a another server using ruby TCPSocket-TCPServer socket libraries? how sholuld i put the TCPSocket(client code) in the controller?

Its very urgent! please help…

Thanks