From: "Хихин Руслан" <hihin@rambler.ru>
To: sysadmins@lists.altlinux.org
Subject: Re: [Sysadmins] q: tcp timeout
Date: Thu, 17 May 2007 00:41:08 +0400
Message-ID: <200705170041.15673@ruslandh> (raw)
In-Reply-To: <5d02dc960705161142g72338dc5w7a19d4433e80ced0@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1905 bytes --]
Здравствуйте Dmytro Cherkasov
> Это я задавал вопрос. Красивое решение, но нам не очень подходит, в
> силу
>
> ряда причин. Вот что я спросить хочу... Есть мысль, переписать
> клиента с
>
> открытем сокета с опцией SO_RCVTIMEO. Это сильно неправильное
> решение будет
>
> ? Учитывая, что это опция на сокет часто помечена как
> недокументированная.
Нашел по манам :)
SVr4, 4.4BSD (эти системные вызовы впервые появились в 4.2BSD). SVr4
документирует дополнительные коды ошибок ENOMEM и ENOSR, но не
документирует флаг4.4BSD 4.4BSD и SO_SNDLOWAT, SO_RCVLOWAT,
SO_SNDTIMEO, SO_RCVTIMEO.
Т.е как я понял в 4.4BSD документировано, в SVr4 -нет, посмотрел по
исходникам ядра - вроде вызывается do_set_sock_timeout, да и в
man 7 socket :
SO_RCVTIMEO and SO_SNDTIMEO
Specify the receiving or sending timeouts until reporting an error. The
parameter is a struct timeval. If an input or output function blocks
for this period of time, and data has been sent or received, the return
value of that function will be the amount of data transferred; if no
data has been transferred and the timeout has been reached then -1 is
returned with errno set to EAGAIN or EWOULDBLOCK just as if the socket
was specified to be nonblocking. If the timeout is set to zero (the
default) then the operation will never timeout.
А вот на практике не пробовал :)
да и http://linux-admin.net.ru/content/572
SO_RCVTIMEO и SO_SNDTIMEO
Указать время ожидания (при передаче или приеме)
сообщения об ошибке. Значения этих опций в Linux
зависят от протокола и не могут быть записаны или
считаны. Их функциональность может быть эмулирована
с помощью alarm(2) или setitimer(2).
--
А ещё говорят так (fortune):
________________________________________________________________________
С уважением Хихин Руслан
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2007-05-16 20:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-15 20:42 Michael Shigorin
2007-05-16 4:37 ` Хихин Руслан
2007-05-16 5:12 ` Sergey
2007-05-16 19:18 ` Хихин Руслан
2007-05-17 18:38 ` Хихин Руслан
2007-05-16 20:41 ` Хихин Руслан [this message]
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=200705170041.15673@ruslandh \
--to=hihin@rambler.ru \
--cc=sysadmins@lists.altlinux.org \
/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 sysadmins discussion
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/sysadmins/0 sysadmins/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 sysadmins sysadmins/ http://lore.altlinux.org/sysadmins \
sysadmins@lists.altlinux.org sysadmins@lists.altlinux.ru sysadmins@lists.altlinux.com
public-inbox-index sysadmins
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.sysadmins
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git