Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Socket programming in Ruby

3 views
Skip to first unread message

Daniel Waite

unread,
Jun 9, 2010, 3:58:47 PM6/9/10
to
What are the requirements for the IP address passed to TCPSocket.new?
Example...

>> require 'socket'
=> true
>> s = TCPSocket.new '127.0.0.1', 6500
Errno::ECONNREFUSED: Connection refused - connect(2)
from (irb):2:in `initialize'
from (irb):2:in `new'
from (irb):2

In other words, what relationship does the machine on which the Ruby
code is being run have with the IP address referenced in the code?
--
Posted via http://www.ruby-forum.com/.

Daniel Waite

unread,
Jun 9, 2010, 4:07:55 PM6/9/10
to
Never mind -- turns out you have to create a TCPServer first.
0 new messages