From: mike yin Date: 2002-09-01T06:02:35+09:00 Subject: using TCPServer/TCPSocket implementing server/client application in win32? This is a multi-part message in MIME format. ------=_NextPart_000_000A_01C25100.1526A820 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Dear guys: I hope you can tell me why I can't use TCPSocket implementing = server/client application in win32 network environment. When both server and client are under irb, they work well. But in = server.rb/client.rb form, just when connecting, the client get an = exception as: 'No connection could be made because the target machine = actively refused it. - "connect(2)" (Errno::E10061)' The server.rb/client.rb are as follows: (server.rb) require 'socket' ss=3DTCPServer.new 'localhost','9090' con=3Dss.accept while !con.eof? puts con.gets end (client.rb) require 'socket' ss=3DTCPSocket.new '192.168.1.10','9090' ss.puts 'I' ss.puts 'Have' ss.puts 'A' ss.puts 'Dream' ss.puts '--Chai' What's the problem? what should I use for server/client application in = win32 then? Thank you very very much. Sincerely, Xinwei ------=_NextPart_000_000A_01C25100.1526A820 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Dear guys:
 
I hope you can tell me why I can't use = TCPSocket=20 implementing server/client application in win32 network=20 environment.
 
When both server and client are under = irb, they=20 work well. But in server.rb/client.rb form, just when connecting, the = client get=20 an exception as: 'No connection could be made because the target machine = actively refused it. - "connect(2)" (Errno::E10061)'
 
The server.rb/client.rb are as=20 follows:
 
(server.rb)
require = 'socket'
ss=3DTCPServer.new=20 'localhost','9090'
con=3Dss.accept
while !con.eof?
 puts=20 con.gets
end
 
(client.rb)
require = 'socket'
ss=3DTCPSocket.new=20 '192.168.1.10','9090'
 ss.puts 'I'
 ss.puts=20 'Have'
 ss.puts 'A'
 ss.puts 'Dream'
 ss.puts=20 '--Chai'
 

What's the problem? what should I use for server/client = application in=20 win32 then?
 
Thank you very very much.
 
Sincerely,
Xinwei
------=_NextPart_000_000A_01C25100.1526A820--