Socket Problems

I'm having some trouble getting ruby sockets working... I have two
scripts: one for the client and one for the server. If I run the two
scripts on the same computer with them both set to connect to localhost
then it works fine, but if I run the scripts on different computers in
the same LAN with the server set to connect to localhost and the client
set to connect to the IP address of the server then I get "No
connection could be made because the target machine actively refused
it. - connect(2) (Errno::ECONNREFUSED)" Any ideas?

Thanks,
Caleb

If you set the server to listen on localhost it will only listen on
the loopback device. Don't set a listen address and it will listen to
everything:

TCPServer.new('',portnum)

ยทยทยท

On Wed, Sep 28, 2005 at 06:16:43AM +0900, jtxx000 wrote:

I'm having some trouble getting ruby sockets working... I have two
scripts: one for the client and one for the server. If I run the two
scripts on the same computer with them both set to connect to localhost
then it works fine, but if I run the scripts on different computers in
the same LAN with the server set to connect to localhost and the client
set to connect to the IP address of the server then I get "No
connection could be made because the target machine actively refused
it. - connect(2) (Errno::ECONNREFUSED)" Any ideas?

That was it! Thanks, I've been trying to figure that out for the last
three days :stuck_out_tongue: