Method: UDPAgent.send_datagram

Defined in:
lib/minitcp.rb

.send_datagram(host, port, mess) ⇒ Object

maintain a connection to a UDP serveur, sleep timer_interconnection_ms millisecondes beetwen each reconnections



262
263
264
265
266
267
# File 'lib/minitcp.rb', line 262

def self.send_datagram(host,port,mess)
      sock = UDPSocket.new
      #p ["sock.send",mess, 0, host, port]
      sock.send(mess, 0, host, port)
      sock.close
end