UDP Server Demo : UDP Server « Network « Ruby






UDP Server Demo


require 'socket'

s = UDPSocket.new
s.bind(nil, 1234)

5.times do
  text, sender = s.recvfrom(16)
  puts text
end

 








Related examples in the same category

1.Making a single program send and receive UDP data to and from itself