method
bind
ruby latest stable - Class:
UDPSocket
bind(host, port)public
Binds udpsocket to host:port.
u1 = UDPSocket .new u1.bind ("127.0.0.1", 4913) u1.send "message-to-self", 0, "127.0.0.1", 4913 p u1.recvfrom(10) #=> ["message-to", ["AF_INET", 4913, "localhost", "127.0.0.1"]]
# File lib/resolv-replace.rb, line 33
def bind(host, port)
host = IPSocket.getaddress(host) if host != ""
original_resolv_bind(host, port)
end