On Fri, Aug 17, 2012 at 5:44 PM, Waldemar Renz <[email protected]> wrote:
> I am very sorry, i totally forgot it.

:-)

> I am using RGSS with the library of Ruby 1.8.1 to get a modified version
> of the Server/Client example from www.ruby-doc.org to run.
>
> Server:
> $s = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM,
> Socket::IPPROTO_TCP)
> $ais = Socket.sockaddr_in(7654, nil)
> $s.bind($ais)
> Kernel.pbMessage(_INTL("Waiting for Player."))
> $s.listen(2)
> client=$s.accept
> client.puts "Hello!"
> Kernel.pbMessage(_INTL("Server initialisiert"))
>
>
> Client:
> $c = Socket.new(Socket::AF_UNSPEC, Socket::SOCK_STREAM,
> Socket::IPPROTO_TCP)
> $aic = Socket.sockaddr_in(7654, '127.0.0.1')
> $c.connect($aic)
> print("Client initialised.")
>
> And the error message points to following line, marked between (*)
>
> class SocketError < StandardError
>   ENOASSOCHOST = "getaddrinfo: no address associated with hostname."
>
>   def self.check
>     errno = Winsock.WSAGetLastError
>     #if not Network.testing? == 1
>      (*) raise Errno.const_get(Errno.constants.detect { |c|
> Errno.const_get(c).new.errno == errno }) (*)
>     #else
>     #  errno != 0 ? (Network.testresult(true)) :
> (Network.testresult(false))
>     #end
>   end
> end

Well, if you comment the condition around the raise then of course
every call to #check will trigger the exception.  Is that your
problem?

Kind regards

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

-- You received this message because you are subscribed to the Google Groups 
ruby-talk-google group. To post to this group, send email to 
[email protected]. To unsubscribe from this group, send email 
to [email protected]. For more options, visit this 
group at https://groups.google.com/d/forum/ruby-talk-google?hl=en

Reply via email to