Re: MCCP through Copyover

From: Patrick Dughi (dughi@imaxx.net)
Date: 07/10/00


>
>         SET_BIT(DESC_FLAGS(d), DESC_CANZLIB);
>
>         /* Write something, and check if it goes error-free */
>         if (write_to_descriptor (desc, buf, strlen(buf)) < 0)
>         {
>            close_socket (d); /* nope */
>            continue;
>         }
>
> So it is creating the Circle descriptor before sending to the raw file
> descriptor. Is this a bad idea? I understand that you want to get rid of
> file descriptors that aren't valid anymore as soon as possible, but...
> Is this just for performance reasons or are there other good ideas for
> doing this?

        Well, you realize that when you do the execl(), your file
descriptors (among other things) are transfered to the new running
instance.  They have already been inited/etc so far as the connection
goes, and directly writing to them is no problem.

        However, since you already have the descriptor, there's
nothing that would stop you from doing it in the order you want.  It was
probably done in this way so one wouldn't allocate the memory for a
descriptor/player/etc if the connection has died (because then it would
all have to be freed).

                                        PjD



     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT