From: Sergey Vlasov <vsu@altlinux.ru> To: ALT Linux community <community@altlinux.ru> Subject: Re: [Comm] Q: Programming sockets in C language troubles Date: Mon, 19 May 2003 16:05:51 +0400 Message-ID: <20030519120551.GA4186@vcserver.mivlgu.local> (raw) In-Reply-To: <20030519113800.GA18016@abr.tool.ru> On Mon, May 19, 2003 at 15:38:00 +0400, Andrey Brindeew wrote: [skip] > 1. Почему у нас на серверной консоли фигурируют 0, 1 и 2 сокеты (я > так понимаю, что это stdin, stdout и stderr сервера собственной > персоной)? Я их в FD_SET не заказывал на прослушивание с помощью > select. :-( Там в цикле ещё должна была быть проверка FD_ISSET(i, &read_fd_set). И обычно вместо FD_SETSIZE ставят max(fd) + 1, чтобы не проверялись лишние биты. > 2. Что за мусор идет после подстроки "protocol_com"? Я так понимаю, что > буфер чтения у сокета заполнился (ибо 12 символов всего), но откуда > мусор? А кто будет \0 в конце для printf добавлять? > 3. Почему сообщение о подсоединении клиента не появилось сразу же после > того, как я подцепился к серверу с помощью telnet? Так из-за отсутствия проверки FD_ISSET она и ждала ввода из stdin. [skip]
next prev parent reply other threads:[~2003-05-19 12:05 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2003-05-19 11:38 Andrey Brindeew 2003-05-19 11:48 ` Sergey Bolshakov 2003-05-19 11:55 ` Sergey Bolshakov 2003-05-19 12:05 ` Sergey Vlasov [this message] 2003-05-23 11:28 ` [Comm] " Andrey Brindeew 2003-05-19 12:14 ` [Comm] " Dmitry V. Levin
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20030519120551.GA4186@vcserver.mivlgu.local \ --to=vsu@altlinux.ru \ --cc=community@altlinux.ru \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux Community general discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 community community/ http://lore.altlinux.org/community \ mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com public-inbox-index community Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.community AGPL code for this site: git clone https://public-inbox.org/public-inbox.git