[Newbies] Sending UDP broadcasts

Christian Kellermann ckeen at pestilenz.org
Fri Feb 4 08:56:38 UTC 2022


Dear List,

I am trying to send a UDP broadcast on a Linux host with the following code:

```
s := Socket newUDP.

s setOption:  'SO_BROADCAST' value: 1.
[[(Delay forSeconds: numberOfSeconds) wait.
	 s sendUDPData: shoutout toHost: '255.255.255.255' port: (self portNumber) ]
repeat] fork.
```

I always get a Primitive Failed error for the sendUDPData message.
shoutout is a string in this case.

What am I missing for this example?

Versions used are: 

Squeak5.3
latest update: #19470
unix linux-gnu x86_64

Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3142]
Unix built on Feb  4 2022 08:41:04 Compiler: Clang 13.0.0
platform sources revision VM: 202201220125 

Kind regards,

Christian


-- 
May you be peaceful, may you live in safety, may you be free from
suffering, and may you live with ease. Also encrypt mails to me:
gpg key 0x068757350D0328634B833B65C537678F6BC627B5



More information about the Beginners mailing list