[DGD] Writing an external network daemon

Felix A. Croes felix at dworkin.nl
Mon Jul 27 21:56:57 CEST 2009


bart at wotf.org wrote:

>[...]
> > UDP is only supported as an addition to an existing (binary) connection;
> > it functions as a kind of out-of-band channel and communicates with the
> > same connection object.  On the server side, the UDP port is the 
> > same as the TCP port; on the client side, the ports can be different.
>
> Does it accept udp packets from other ips then the one that it has a binary
> connection with?

The IP number has to match, as well.


>[...]
> open_datagram() doesn't take any arguments so I assume the client port is
> known internally, but not exposed to the lpc layer? (its not really needed
> there at any rate for all I can tell, tho it might be desirable to know I can
> imagine)

The client port is hidden from the LPC layer.  Only the IP number,
which is the same for both TCP and UDP on a connection, is known.


> > UDP packets are passed on to the connection object as they are
> > received.  DGD makes no attempt at packet reassembly or preventing
> > out-of-order reception.  Only one UDP packet can be sent by each
> > connection object per execution round.
>
> This also applies to the network package, but it extends this with a
> datagram_done() callback similar to message_done() for telnet and binary tcp
> connections to make buffering in lpc easy and similar to tcp buffering.

I can see why you would want it to be similar, but since there is no
flow control for UDP, there is no need for the callback.

Regards,
Felix Croes



More information about the DGD mailing list