From: Shannon Fang Date: 2005-11-25T10:11:48+09:00 Subject: Re: UDP Socket problem I run the program on winxp, is that causing problems??? I will test on linux, if anything interesting I will report. thanks, shannon >From: ts >Reply-To: ruby-talk@ruby-lang.org >To: ruby-talk@ruby-lang.org (ruby-talk ML) >CC: ruby-talk@ruby-lang.org >Subject: Re: UDP Socket problem >Date: Fri, 25 Nov 2005 00:58:55 +0900 > > >>>>> "S" == Shannon Fang writes: > > > I can't reproduce > >S> CLIENT > >moulon% ruby >require 'socket' >socket = UDPSocket.open >socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_BROADCAST, true) >socket.send("sample", 0, '255.255.255.255', 4321) >socket.send("1234567890123456789012345678901234567890123456789012345678901234567890", > 0, '255.255.255.255', 4321) >moulon% > > >S> SERVER > >moulon% ruby >require 'socket' >server = UDPSocket.open >server.bind('0.0.0.0', 4321) >while true do > p server.recvfrom(10) >end >["sample", ["AF_INET", 47842, "moulon.inra.fr", "138.102.114.1"]] >["1234567890", ["AF_INET", 47842, "moulon.inra.fr", "138.102.114.1"]] >^C >-:5:in `recvfrom': Interrupt > from -:5 >moulon% > > >Guy Decoux >