Re: [CODE] Sockets...Anybody? Help?

From: George (greerga@circlemud.org)
Date: 11/10/98


On Thu, 5 Nov 1998, Jourge Fuzz Bush wrote:

>Code:
>(some of the lines might get cut off because of the size of window you
>are using is too small. Just maximize the window)

Not on a 132x43 terminal it doesn't. ;)

>int sendcmd (int handel, char *line, struct char_data *ch)
>{
>        int bytessent, length, position = 0, a, b, c;
>        char *buf, *buf2;
>        length = strlen(line);
>        buf = line;

Missing a "do"

>        {
>                bytessent = send(handel, buf, strlen(buf), 0);
>                if (bytessent == -1)
>                        return -1;
>                else if (bytessent != strlen(buf)){
>                        b = 0;
>                        position += (bytessent + 1);
>                        for     (a = (bytessent + 1); a < strlen(buf); a++, b++)
>                        {
>                                buf2[b] = buf[a];
>                        }
>                        buf2[b + 1] = '\0';
>                        buf = buf2;
>                        c = -1;
>                }
>                else {
>                        c = bytessent;
>                }
>        } while (c == -1);
>
>        return (c);
>}

What is wrong with write_to_descriptor() ?

--
George Greer, greerga@circlemud.org | Genius may have its limitations, but
http://mouse.van.ml.org/   (mostly) | stupidity is not thus handicapped.
http://www.van.ml.org/CircleMUD/    |                  -- Elbert Hubbard


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



This archive was generated by hypermail 2b30 : 12/15/00 PST