[DGD] Writing an external network daemon

bart at wotf.org bart at wotf.org
Mon Jul 27 16:38:24 CEST 2009


Please note that the network package changes udp behavior quite a bit. My
answer concerns the network package.

First of all, with the network package, udp communications is done with a
'port object'. This port object opens a port for listening for udp datagrams,
and also uses that same port for sending them. Because this is UDP, there is
no sense of 'connection' at all, and no 'connection object' involved.

When an udp datagram is received, receive_datagram() is called in this udp
port object with as arguments the datagram, (remote) ip and (remote) port.

No other information is available.

For dgd 'vanilla' this works a bit different, and I don't think you get more
then the datagram itself.

Bart.

On Mon, 27 Jul 2009 09:28:26 -0400, Blake Arnold wrote
> What data from the UDP connection object is passed on to the Klib? I 
> know that the 'ip:port' pair makes up the connection object. Is this 
> the only information that is available?
> 
> Blake Arnold
> IT Tech Suport
> E:barnold at cartonservice.com
> P:419-342-9524
> 
> -----Original Message-----
> From: dgd-bounces at dworkin.nl [mailto:dgd-bounces at dworkin.nl] On 
> Behalf Of Petter Nyström Sent: Sunday, July 26, 2009 9:32 AM To: All 
> about Dworkin's Game Driver Subject: [DGD] Writing an external 
> network daemon
> 
> The recent thread "networking/beginner comments" re-sparked my wish 
> to write an external network daemon for my MUD. The concept of an 
> external network daemon has been discussed earlier on this list as 
> an alternative solution to the network package. I do not have a real 
> need for outgoing network connections in my MUD at this point, and 
> if I did I'd probably be using the network package anyway. So this 
> is just an exercise for myself.
> 
> Anyway, to get to my question. I have most of the stuff operational
> now: objects can inherit an API that allows them to request an
> outgoing connection and is hooked up by the external daemon that let
> them send data back and forth. But my problem is this: how should I
> best control the flow of data that it passed to receive_message()? My
> alternatives have been:
> 
>  * Let the external daemon pass on character by character to
> receive_message() and let the LPC layer deal with buffering and so
> forth.
> 
>  * Let the external daemon know something about the protocol that is
> to be used, so that i can do buffering by newline, EOF-mark, 
> whatever; and then send appropriate chunks of data to 
> receive_message().
> 
>  * Let the external daemon buffer for as long as there is data to be
> read from the socket, and send the buffer to receive_message() when
> there is no more data to read. But this seems like it could get into
> an undefined behaviour pretty easily if there is a busy connection?
> 
> I feel that I'm lacking some knowledge in the networking field here.
> Please advice! =)
> 
> For example, how does the networking package work?
> 
> Thanks,
> 
> Jimorie
> ___________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd
> ___________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd


--
Created with Open WebMail at http://www.bartsplace.net/
Read my weblog at http://soapbox.bartsplace.net/




More information about the DGD mailing list