From: Reinhard M. <ma...@tc...> - 2012-03-29 10:10:22
|
On Thu, 29 Mar 2012 at 11:03, Donal K. Fellows wrote: > On 28/03/2012 13:58, Reinhard Max wrote: > >> I have a patch that adds a -domain switch (I don't insist on the >> naming), but I haven't synced it with trunk for a year. IIRC it was >> only tested on Linux so far. > > Do we have that in a branch? It is in a local sandbox for now, but could commit it to a branch after some polishing. Merging with trunk shouldn't be too hard since it only touches areas that didn't get touched much recently. >> Because it was easy to do while being there, this patch also adds >> basic support for UDP via a -type switch. > > I'm not so keen on that. The problem is that the interaction model > of channels is that of a (lossless) stream, which is a perfect match > for TCP sockets (and pipes) but bad when it comes to UDP. I suspect > that SOCK_DGRAM ought to be done through a different paradigm. That's why I wrote *basic* support. It doesn't (yet) do a lot of the things that can be done with UDP, but don't fit the channel paradigm, but it does allow the (IMO valid) use of UDP in a TCP-ish way. I'd rather have it this limited way and start improving it from there than not having it for another Tcl core release, "because UDP doesn't fit channels". Also, I still hope that we can extend channels for full UDP support instead of inventing something completely new. After all, for the OS it is also just another type of sockets that allow some more operations than just read and write. One example to get sockets a bit closer to UDP would that UDP sockets are always in -buffering none mode, so that every write operarion results in a datagram to get sent out. On the receiving side, the use of [gets] should be discouraged, and an unlimited [read] would always return exactly one datagram. cu Reinhard |