UDP (datagram) socket usage.

Dar Scott dsc at swcp.com
Tue Dec 28 12:57:10 EST 2004


On Dec 28, 2004, at 6:03 AM, Alex Tweedly wrote:

>> When you 'open datagram socket', specify a callback.  The callback is 
>> NOT for completion of the open.  That completes immediately.  It is 
>> for the incoming packets, the responses.
>
> I could have tried for a month of Sundays without guessing that  - 
> thank you.

Me, too.  I learned about from Scott Raney when I reported a bug.  
Somehow, what I had been doing was working.

I think there is a motivation for TCP to do it the UDP way.  I wonder 
if there is a hole in the Revolution model for TCP in which a data 
packet with a FIN can come in during the gap between reads and the data 
get lost.

> I've been working with connectionless protocols including UDP for the 
> best part of 20 years; I'm pretty comfortable with distributed 
> algorithms - the model fits this application very nicely.

Me, too.  We might be resources for each other.

> It's simply the translation of the standard BSD-socket API into Rev 
> that's confusing me (and the rather less than helpful docs).

I don't mind the Rev API.  Doing away with select is a great plus, the 
weakest link in BSD sockets.  I do find things I want to do such that I 
can't.  You mentioned getting the local port.  I have a protocol in 
which I need to set it.

I had proposed a peer-to-peer model for Revolution UDP some time back, 
but when it was set up, it was set up as client-server and used accept. 
  (One problem with that is that if you set up a server for both UDP and 
TCP on the same port, then they look the same on openSockets() and to 
close socket.)

Dar

**********************************************
     DSC (Dar Scott Consulting & Dar's Lab)
     http://www.swcp.com/dsc/
     Programming Services and Software
**********************************************



More information about the use-livecode mailing list