R
Robert Garrido
Hi all,
I use a TCP connection and send some data like this:
begin
session = "mysession"
socket = TCPSocket.new(tcpaddress, port)
socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
puts "sending to socket HELO " + session
socket.write ('HELO ' + session)
puts socket.read
socket.close
rescue Exception => myException
puts "Exception rescued : #{myException}"
end
The socket never gets a reply, however telnet does:
$ telnet some_ip port
Trying some_ip...
Connected to some_ip
Escape character is '^]'.
HELO mysession
OK
As you can see the remote server replies "OK" as expected. What's wrong?
Thanks in advanced!
PS: I have used puts and send methods also
I use a TCP connection and send some data like this:
begin
session = "mysession"
socket = TCPSocket.new(tcpaddress, port)
socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
puts "sending to socket HELO " + session
socket.write ('HELO ' + session)
puts socket.read
socket.close
rescue Exception => myException
puts "Exception rescued : #{myException}"
end
The socket never gets a reply, however telnet does:
$ telnet some_ip port
Trying some_ip...
Connected to some_ip
Escape character is '^]'.
HELO mysession
OK
As you can see the remote server replies "OK" as expected. What's wrong?
Thanks in advanced!
PS: I have used puts and send methods also