Feb. 6, 2012
9:55 p.m.
Todd, On 06 Feb 2012, at 22:22, Eagle Offshore wrote:
[| socket | socket := Socket newUDP. 10 timesRepeat: [| s | s := String new. socket receiveDataInto: s fromHost: (NetNameResolver addressFromString:'255.255.255.255' ) port: 4848. Transcript show: s.]] fork
and it doesn't seem to do anything.
What have I missed?
It is a non-blocking API, so you have to write some code to keep on listening until some timeout, in a loop with small delays, like 50ms. Also, you have to preallocate a non-empty buffer. I have some working code for this, but it is not clean/standalone enough to show here ;-) If you can't figure it out yourself, just ask and I will mail some of it to you off list. Regards, Sven