require "socket" s=TCPServer.new("localhost",3000) c=s.accept udpsocks=[] tcpsocks=[] next_sock=0 puts "Connection established" while true ch=c.getc if ch==nil next end cmd=ch.ord if cmd==0 c.print [192,168,0,10].pack("CCCC") end if cmd==1 sock=UDPSocket.new() sock.bind("10.0.0.180",0) c.print [next_sock,sock.addr[1]].pack("L