Thanks Sven for the indications.
Of course I already looked at this Test, but I got lost. I looked at it
again, and wrote something like:
| socket data | socket := Socket newUDP. socket setPort: 9999.
socket waitForConnectionFor: 2; waitForDataFor: 5 . data := Array
new: 100. [socket receiveUDPDataInto: data. data crLog]
ensure: [ 'Closing socket' crLog. socket closeAndDestroy]
I do not have error, but a time out.
I broadcast from the Linux shell:
echo 10.7.2.1 | nc -ub 255.255.255.255 9999
The broadcast itself is fine as I can receive it from another shell:
nc -ulk 9999
10.7.2.1
Any idea?
Thanks
Hilaire
Le 20/05/2018 à 21:43, Sven Van Caekenberghe a écrit :
Hi Hilaire,
Check UDPSocketEchoTest for a good, simple example of using UDP sockets in
Pharo.
You should not do #connectTo:port: but just #setPort: and listen.
HTH,
Sven
--
Dr. Geo
http://drgeo.eu