[14] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next next in chain last in chain last

Re: $connection and $sys.startup()

daemon@ATHENA.MIT.EDU (Mon Nov 15 20:48:08 1993 )

To: Lynx <BRANDON@cc.usu.edu>
Cc: coldstuff@MIT.EDU
In-Reply-To: Your message of Mon, 15 Nov 93 18:04:22 -0600.
             <01H5CQHSNW6YANHKWW@cc.usu.edu> 
Date: Mon, 15 Nov 93 20:43:33 EST
From: Greg Hudson <ghudson@MIT.EDU>


Sorry, maybe I didn't explain well enough.

> for obj in ($connection.children())
>   destroy(obj);

> well, this wouldnt work, so I changed it to:

> for obj in ($connection.children())
>    obj.destroy();

I'd like to hear why my code wouldn't work.  Keep in mind that nothing
keeps track of connection objects except for $sys, which starts off
with a clean slate.

> _dont_ do this, you cannot re-connect.

If you put it in the wrong place, yes.  The code should be placed near
the beginning of $sys.startup().

>   olist = $connection.children();
>   for o in [1..listlen(olist) -1]
>     olist[o].destroy();

> this will leave 1 child of $connection, so you can connect.  I dont
> know if this is the best way to do it, but it works :)

This is *not* the right way to do it.  It will leave one connection
object, but there is no guarantee that it is the particular one that
the system object has as the receiver on the port.  You got lucky.

--GBH