UDP sockets???

John M McIntosh johnmci at smalltalkconsulting.com
Tue Dec 5 03:58:52 UTC 2000

>Does #waitForDataUntil: applies to UDP sockets?  I'm having a hard
>time telling which methods apply to UDP sockets, TCP sockets, or
>I'm trying to confine myself to the methods in the category
>"datagrams".  But the examples (in the class methods) don't seem to
>bother (using methods in "datagram"). Why?

Since I last tampered with the Smalltalk code for UDP I can say I 
didn't really pay too much attention to the categories in the browser 
when writing the Smalltalk Code, thus I'm afraid you'll need to look 
at all the code to better understand UDP.

In terms of UDP support, support of course is dictated by the support 
available from the VM for the target platform. For the macintosh all 
the UDP stuff should work. Now I can't say anyone has actually wrote 
me about using it. On the mac, both UDP and TCP incoming data will 
signal the readData semaphore. UDP data is buffered into internal VM 
buffers if there are any available, otherwise you will loose UDP 
traffic, so normally you should be able to do the waitForDataUntil: 
then read your UDP datagram.

Other notes on the mac the UDP sockets should behave the same as TCP 
sockets except for:

UDP sockets always stay connected if they are valid.
You can't listen with backlog size on a UDP port.
You can't do an accept on a UDP socket
There are some interesting bugs for which we hopefully have 
considered in Open Transport 1.1.3 for UDP

There are of course a number of primitives that are specific to UDP 
sockets to setup connections, and read/write data which allow you to 
indicate the remote IP and port.
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
Custom Macintosh programming & various Smalltalk dialects
PGP Key: DSS/Diff/46FC3BE6
Fingerprint=B22F 7D67 92B7 5D52 72D7  E94A EE69 2D21 46FC 3BE6

More information about the Squeak-dev mailing list