>>>>> "X" == Xiangrong Fang <xrfang / hotmail.com> writes:

X> I tried the following, but unfortunately does not work:

 it do the same ?

X> require 'socket'
X> begin
X>   server = Socket.new(Socket::PF_INET, Socket::SOCK_STREAM, 0)
X>   server.setsockopt(Socket::SOL_SOCKET, -5, 1) #Socket::SO_EXCLUSIVEADDRUSE

 -5 ? Microsoft is very strange ...

X>   n = Socket.gethostbyname("localhost")
X>   sockaddr = [Socket::AF_INET, 3456, n[3], 0, 0].pack("snA4NN")

 ruby has Socket::sockaddr_in, ::pack_sockaddr_in, ::unpack_sockaddr_in


Guy Decoux