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
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
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
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
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
> 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
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
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
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
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.
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
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:
12 matches
Mail list logo