Repository 32bit  Forum
Repository 64bit  Wiki

disabilitare algoritmo di nagle

Forum dedicato alla programmazione.

Moderatore: Staff

Regole del forum
1) Citare in modo preciso il linguaggio di programmazione usato.
2) Se possibile portare un esempio del risultato atteso.
3) Leggere attentamente le risposte ricevute.
4) Scrivere i messaggi con il colore di default, evitare altri colori.
5) Scrivere in Italiano o in Inglese, se possibile grammaticalmente corretto, evitate stili di scrittura poco chiari, quindi nessuna abbreviazione tipo telegramma o scrittura stile SMS o CHAT.
6) Appena registrati è consigliato presentarsi nel forum dedicato.

La non osservanza delle regole porta a provvedimenti di vari tipo da parte dello staff, in particolare la non osservanza della regola 5 porta alla cancellazione del post e alla segnalazione dell'utente. In caso di recidività l'utente rischia il ban temporaneo.

disabilitare algoritmo di nagle

Messaggioda Toni » mar ott 06, 2009 23:40

ciao a tutti

sapete se è possibile disattivare l'algoritmo di nagle su un socket tcp tramite le glibc?

dando un occhiata al manuale
http://www.gnu.org/software/libc/manual ... /libc.html

in particolare:

Previous: Socket Option Functions, Up: Socket Options
16.12.2 Socket-Level Options
— Constant: int SOL_SOCKET

Use this constant as the level argument to getsockopt or setsockopt to manipulate the socket-level options described in this section.

Here is a table of socket-level option names; all are defined in the header file sys/socket.h.

SO_DEBUG

This option toggles recording of debugging information in the underlying protocol modules. The value has type int; a nonzero value means “yes”.
SO_REUSEADDR
This option controls whether bind (see Setting Address) should permit reuse of local addresses for this socket. If you enable this option, you can actually have two sockets with the same Internet port number; but the system won't allow you to use the two identically-named sockets in a way that would confuse the Internet. The reason for this option is that some higher-level Internet protocols, including FTP, require you to keep reusing the same port number.

The value has type int; a nonzero value means “yes”.
SO_KEEPALIVE
This option controls whether the underlying protocol should periodically transmit messages on a connected socket. If the peer fails to respond to these messages, the connection is considered broken. The value has type int; a nonzero value means “yes”.
SO_DONTROUTE
This option controls whether outgoing messages bypass the normal message routing facilities. If set, messages are sent directly to the network interface instead. The value has type int; a nonzero value means “yes”.
SO_LINGER
This option specifies what should happen when the socket of a type that promises reliable delivery still has untransmitted messages when it is closed; see Closing a Socket. The value has type struct linger.
— Data Type: struct linger

This structure type has the following members:

int l_onoff
This field is interpreted as a boolean. If nonzero, close blocks until the data are transmitted or the timeout period has expired.
int l_linger
This specifies the timeout period, in seconds.


SO_BROADCAST
This option controls whether datagrams may be broadcast from the socket. The value has type int; a nonzero value means “yes”.
SO_OOBINLINE
If this option is set, out-of-band data received on the socket is placed in the normal input queue. This permits it to be read using read or recv without specifying the MSG_OOB flag. See Out-of-Band Data. The value has type int; a nonzero value means “yes”.
SO_SNDBUF
This option gets or sets the size of the output buffer. The value is a size_t, which is the size in bytes.
SO_RCVBUF
This option gets or sets the size of the input buffer. The value is a size_t, which is the size in bytes.
SO_STYLE
SO_TYPE
This option can be used with getsockopt only. It is used to get the socket's communication style. SO_TYPE is the historical name, and SO_STYLE is the preferred name in GNU. The value has type int and its value designates a communication style; see Communication Styles.
SO_ERROR

This option can be used with getsockopt only. It is used to reset the error status of the socket. The value is an int, which represents the previous error status.




sembrerebbe di no, eppure questi tizii da unix ci riescono:
http://www.developerweb.net/forum/showthread.php?t=2950

qualche suggerimento?
grazie
Avatar utente
Toni
Linux 2.6
Linux 2.6
 
Messaggi: 993
Iscritto il: lun gen 30, 2006 22:08
Località: milano
Slackware: slackware-14
Kernel: 3.10.5
Desktop: i3

Torna a Programmazione

Chi c’è in linea

Visitano il forum: Google [Bot] e 2 ospiti