Getting a client's IP address with EventMachine
1 2 EventMachine::run { 3 EventMachine::open_datagram_socket $conf[:address], 4 $conf[:udp_port], CustomServer 5 } 6 7 module CustomServer 8 def receive_data d 9 pp get_peername[2,6].unpack "nC4" 10 end 11 end