Ruby 的 UDP 服务器简单一例 2015/05/28 16848 require 'socket' s = UDPSocket.new s.bind(nil, 1234) 5.times do text, sender = s.recvfrom(16) puts text end