Re: [Pharo-users] On UDP broadcast

2018-05-24 Thread Hilaire
I took a look of course. Thanks. At my basic level of knowledge, I found the articles on the Pharo books and the basic Tests on Socket very helpful. Hilaire Le 23/05/2018 à 17:42, N. Bouraqadi a écrit : Note that the package includes tests that show that the broadcast working :-) Thanx

Re: [Pharo-users] On UDP broadcast

2018-05-24 Thread Hilaire
Hi Henrik, Le 22/05/2018 à 10:57, Henrik Sperre Johansen a écrit : With UDP, there is no connection concept, so I'd reckon waitForConnectionFor: is what gives you a TimeOut error... The #waitForConnectionFor: message seems not to be the issue. I was doing something apparently stupid: I

Re: [Pharo-users] On UDP broadcast

2018-05-23 Thread N. Bouraqadi
Note that the package includes tests that show that the broadcast working :-) Thanx Cédrick for the CC. Noury > On 21 May 2018, at 21:17, Cédrick Béler wrote: > > Noury did. He sent that on the other thread : > > « Just want to point that I did some work late 2017 on UDP

Re: [Pharo-users] On UDP broadcast

2018-05-22 Thread Henrik Sperre Johansen
HilaireFernandes wrote > 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: . > socket waitForConnectionFor: 2; waitForDataFor: 5

Re: [Pharo-users] On UDP broadcast

2018-05-21 Thread Cédrick Béler
Noury did. He sent that on the other thread : « Just want to point that I did some work late 2017 on UDP sockets including multicast and broadcast. The package named 'NetworkExtras' is part of the ReusableBricks repo of my team. http://smalltalkhub.com/#!/~CAR/ReusableBricks It has some

Re: [Pharo-users] On UDP broadcast

2018-05-21 Thread Sven Van Caekenberghe
> On 21 May 2018, at 19:37, Stephan Eggermont wrote: > > Sven Van Caekenberghe wrote:. >> >> I can't get the broadcast sending via nc to work (like your terminal >> example). The -b nc option on macOS is not related to broadcasting. > > Who’s allowed to

Re: [Pharo-users] On UDP broadcast

2018-05-21 Thread Stephan Eggermont
Sven Van Caekenberghe wrote:. > > I can't get the broadcast sending via nc to work (like your terminal > example). The -b nc option on macOS is not related to broadcasting. Who’s allowed to broadcast? Stephan

Re: [Pharo-users] On UDP broadcast

2018-05-21 Thread Sven Van Caekenberghe
Hilaire, All this is quite tricky and can be platform dependent. What works for me (non-broadcast) is the following Pharo code for listening: socket := Socket newUDP setPort: ; yourself. buffer := ByteArray new: 256. { buffer. socket waitForDataFor: 60; receiveUDPDataInto: buffer }. "socket

Re: [Pharo-users] On UDP broadcast

2018-05-21 Thread Hilaire
Le 21/05/2018 à 10:56, Hilaire a écrit : Of course I already looked at this Test, but I got lost. I looked at it again, and wrote something like: Sorry for the badly formated code. By the way the exception handler does not work in the code version bellow. When the ConnectionTimedOut is raised

Re: [Pharo-users] On UDP broadcast

2018-05-21 Thread Hilaire
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: . socket waitForConnectionFor: 2; waitForDataFor: 5 . data := Array new: 100.    

Re: [Pharo-users] On UDP broadcast

2018-05-20 Thread Sven Van Caekenberghe
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 > On 20 May 2018, at 20:59, Hilaire wrote: > > Hi, > > I try to figure out this matter. I am just new

[Pharo-users] On UDP broadcast

2018-05-20 Thread Hilaire
Hi, I try to figure out this matter. I am just new to this domain so excuse me for the obvious the errors. To broadcast an IP, this seems to work: | socket | socket := Socket newUDP. socket setOption: 'SO_BROADCAST' value: true. 10 timesRepeat: [     socket sendUDPData: '10.7.2.1'  toHost: