On 17 Apr 2008, at 05:34, Kr Alfabeta wrote: > >> i think you just want to check a udp connection to a udp server. no >> problem. >> >> require 'socket' >> s = UDPSocket.new >> s.connect("10.10.10.10", 10101) >> puts "you are connected" #<-- if you get here, you are connected >> > > when I trying to connect with PHP (fsockopen) it fails: Warning: > fsockopen() [function.fsockopen]: unable to connect to xxx.xx.xx.xx: > 2555 > (No route to host) > > RUBY: > > irb(main):001:0> require 'socket' > => true > irb(main):002:0> s = UDPSocket.new > => #<UDPSocket:0xb7d3c590> > irb(main):003:0> s.connect('xxx.xx.xx.xx', 2555) > => 0 > irb(main):004:0> puts 'ok' > ok > => nil > > I think this example really shows the problem about which I am talking > :) All that is doing, is checking that the IP is routable. Nothing more. This has nothing to do with the port availability or providing you with *any* information as to whether or not the application is available at the other end. Please carefully read my other responses and the referenced manuals and documentation. What you're asking for is impossible. > > -- > Posted via http://www.ruby-forum.com/. >