Thursday, June 10, 2010

[Rails] TCP Sockets

I am trying to interface to an API. I am instructed to use the server
and port information provided to setup a TCP socket. I did that like
this:

require 'socket'
my_socket=TCPSocket::open("ip","port")

Where "ip" and "port" are the provided ip and port of the server
respectively.

I am told that once the connection is established I will receive a
greeting from the server. I was expecting to find that greeting in
my_socket. Instead the contents of my_socket looks like this:

#<TCPSocket:0x9961c80>

Can anyone please tell me what I am doing wrong and what I need to do
to get at the greeting? Obviously I am very green at this. Thanks
for any input.

... doug

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate