Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > connecting to a simple server on Windows using socket

Reply
Thread Tools

connecting to a simple server on Windows using socket

 
 
pmr16366@gmail.com
Guest
Posts: n/a
 
      04-10-2006
I have a simple server running under Windows using c#
Im trying to connect to it using a ruby client but get the following
error

ai_family not supported. (SocketError)

The c# server is using 'InterNetwork' which means " Address for IP
version 4."
( from
http://msdn.microsoft.com/library/en...asp?frame=true
)


I can connect fine using a c# client.
The only posts I can see to fix this are several years old and involve
recompiling ruby ( which isnt an option for me)

My client code is:
t = TCPSocket.new( 'pc_name' , 399)
puts t.addr.inspect
puts t.peeraddr.inspect
data = t.recvfrom(30)

I get the error on the last line.
Heres the ful output

["AF_INET", 4281, "pc_name.mshome.net", "192.168.0.100"]
["AF_INET", 399, "pc_name.mshome.net", "192.168.0.100"]
J:/sender.rb:11:in `recvfrom': getnameinfo: ai_family not supported.
(SocketError)


Thanks

Paul

 
Reply With Quote
 
 
 
 
Codemonk
Guest
Posts: n/a
 
      04-10-2006
Sorry man, you're going to have to change your last name to get this to
work

 
Reply With Quote
 
 
 
 
Kenosis
Guest
Posts: n/a
 
      04-10-2006
I too have seen this error for a Ruby 1.8.x distro I build w/all
extenstion on Redhat AS 2.1. I couldn't determine why this was
either. Fortunately, I had other Linux distros to work with and the
others, e.g,., CentOS, worked fine. Hmmmm...

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Steve Holden Python 1 02-03-2009 06:20 AM
Re: socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Steve Holden Python 0 02-01-2009 12:45 PM
Re: socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Laszlo Nagy Python 0 02-01-2009 07:37 AM
socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Laszlo Nagy Python 1 01-27-2009 05:05 PM
Re: socket.unbind or socket.unlisten? - socket.error: (48,'Address already in use') Jean-Paul Calderone Python 0 01-27-2009 01:41 PM



Advertisments