Experimenting with #sendUDPData:toHost:port:
Stefan Kersten
kerstens at cs.tu-berlin.de
Sat Dec 9 02:09:01 UTC 2000
John M McIntosh wrote:
> Well you could try running the Socket test suite found at
>
> http://www.smalltalkconsulting.com/html/OTNotes4.html
>
> A bit of work to get going, but it does have examples of many ways to
> abuse the Sockets protocols.
>
> If this isn't based on a macintosh 2.8.x or 2.9.x VM then I can't
> speak for the likely hood of the UDP support working.
>
> But I see that
> Socket>>sendUDPData:toHost:port:
>
> is only invoked by
>
> Socket>>sendData:toHost: port:
>
> which is only invoked by the UDP tests
>
> Socket class>>clientServerTestUDP2
>
> and the
> Socket class>>timeTestUDP timeTestUDP2 timeTestUDP3
>
> These do work on the macintosh.
Does this hold for Linux, too? I am using Ian Piumarta's 2.8 VM and in
sqUnixSocket.c he states that UDP support probably is still missing in
the image -- I just don't have a clue where to start looking.
A problem I ran into is that when attempting to send data back to the
sender's address (obtained via Socket>>receiveUDPDataInto:) from a
server socket, address and port are all zeros:
(
| s1 s2 |
Socket initializeNetwork.
s1 _ Socket newUDP.
s1 setPort: 2222.
s2 _ Socket newUDP.
s2 sendData: 'Squirrel.' toHost: NetNameResolver localHostAddress port: 2222.
s1 dataAvailable ifTrue: [(s1 receiveUDPDataInto: (String new: 32)) inspect].
s1 close; destroy.
s2 close; destroy.
)
Am I missing something?
Many thanks,
<sk>
More information about the Squeak-dev
mailing list
|