SDL_net NODELAY

Hi!

Is SDL_net using the NODELAY option on TCP sockets by default? If not,
is it correct, that there is no way to influence that without
recompiling the library?

Thanks for your help!

/* $Id: SDLnetTCP.c 4211 2008-12-08 00:27:32Z slouken $ */

#ifdef TCP_NODELAY
/* Set the nodelay TCP option for real-time games /
{ int yes = 1;
setsockopt(sock->channel, IPPROTO_TCP, TCP_NODELAY, (char
)&yes, sizeof(yes));
}
#endif /* TCP_NODELAY */

It looks like it’s used where the macro exists (is that everywhere?)On Fri, Feb 6, 2009 at 5:48 PM, Christian Meyer wrote:

Is SDL_net using the NODELAY option on TCP sockets by default? If not, is it
correct, that there is no way to influence that without recompiling the
library?


http://codebad.com/

In windows, it seems that winsock.h does indeed have it set to
TCP_DELAY to true.
On linux, it seems TCP_DELAY is set to false.On 2/6/09, Christian Meyer wrote:

Hi!

Is SDL_net using the NODELAY option on TCP sockets by default? If not, is
it correct, that there is no way to influence that without recompiling the
library?

Thanks for your help!

What do you mean? What is “TCP_DELAY?” I would assume you meant
TCP_NODELAY, but how can that be set to ‘true’ or ‘false’? It’s a bit
maskOn Sat, Feb 7, 2009 at 5:50 PM, bugs buggy wrote:

In windows, it seems that winsock.h does indeed have it set to
TCP_DELAY to true.
On linux, it seems TCP_DELAY is set to false.


http://codebad.com/

Err, not a bit mask, but a numeric option. That is: it’s an argument
to setsockopt() that tells it what “sock opt” you’re adjusting,
TCP_NODELAY can’t just be “true” or “false,” it has to uniquely
identify the setsockopt() option.On Sat, Feb 7, 2009 at 6:46 PM, Donny Viszneki <@Donny_Viszneki> wrote:

What do you mean? What is “TCP_DELAY?” I would assume you meant
TCP_NODELAY, but how can that be set to ‘true’ or ‘false’? It’s a bit
mask


http://codebad.com/

Oh, sorry. Let me fix the post :wink:

in winsock.h:
#define TCP_NODELAY 0x0001
in SDL_netTCP.c:
#ifdef TCP_NODELAY
/* Set the nodelay TCP option for real-time games /
{ int yes = 1;
setsockopt(sock->channel, IPPROTO_TCP, TCP_NODELAY, (char
)&yes, sizeof(yes));
}
#endif /* TCP_NODELAY */

I hope that clears things up?On 2/7/09, Donny Viszneki <donny.viszneki at gmail.com> wrote:

On Sat, Feb 7, 2009 at 5:50 PM, bugs buggy <@buginator> wrote:

In windows, it seems that winsock.h does indeed have it set to
TCP_DELAY to true.
On linux, it seems TCP_DELAY is set to false.

What do you mean? What is “TCP_DELAY?” I would assume you meant
TCP_NODELAY, but how can that be set to ‘true’ or ‘false’? It’s a bit
mask

On linux, it seems TCP_DELAY is set to false.

On both my Linux and Mac OS X boxes, I have TCP_NODELAY set to a
non-zero value in /usr/include/netinet/tcp.h.On Sat, Feb 7, 2009 at 5:50 PM, bugs buggy wrote:


http://pphaneuf.livejournal.com/

On x86 Debian GNU/Linux 4.0 my TCP_NODELAY is also bound to 1

But that’s not the point. The opt argument to setsockopt() is only
allowed to be one of a certain set of macros, one of them could be
zero, and it wouldn’t matter, because SDL_net doesn’t say #if
TCP_NODELAY==0, it says #ifdef TCP_NODELAYOn Sat, Feb 7, 2009 at 7:05 PM, Pierre Phaneuf wrote:

On Sat, Feb 7, 2009 at 5:50 PM, bugs buggy wrote:

On linux, it seems TCP_DELAY is set to false.

On both my Linux and Mac OS X boxes, I have TCP_NODELAY set to a
non-zero value in /usr/include/netinet/tcp.h.


http://codebad.com/

But that’s not the point. The opt argument to setsockopt() is only
allowed to be one of a certain set of macros, one of them could be
zero, and it wouldn’t matter, because SDL_net doesn’t say #if
TCP_NODELAY==0, it says #ifdef TCP_NODELAY

I agree, just saying it’s “double safe”, I don’t see why it wouldn’t
kick in (personally, I’d confirm it with strace, if I cared that
much).On Sun, Feb 8, 2009 at 12:15 AM, Donny Viszneki <donny.viszneki at gmail.com> wrote:


http://pphaneuf.livejournal.com/