From: Victor Reyes Date: 2007-12-28T00:13:56+09:00 Subject: How do I get the hostname or IP address during a TCPServer "conversation" ------=_Part_10682_23034123.1198768442080 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello Team, I have a client which connects to the simple server listed below. I would like to be able to get either the hostname or the IP address of the client. Is there a way to do this? I am sure that this information is hidden in some place, as the server needs it to return the call. Also, in the client code I specified the length of the arriving (recv) string. Is there a way to receive any size output from the server? Thank you This is the server code: require 'socket' port = 19557 server = TCPServer.new("", port) while (session = server.accept) input = session.gets userCMD_output = `#{input}` session.write("#{userCMD_output}") session.close end This is the client code: def runIt( srvr, comm ) require 'socket' port = 19557 streamSock = TCPSocket.new( srvr, port ) streamSock.puts("#{comm}\n") str = streamSock.recv( 64000 ) puts "Output from Server: #{srvr}" print str puts "\n" streamSock.close end Victor ------=_Part_10682_23034123.1198768442080--