I try to make sure that every time I call the socket.send function, my buffer is sent (flushed) to my server (which is in C using a unix socket).
From my understanding (and from what I see on this board), just turning off the altar. should do this, but my server is still receiving my data in a piece of 4096 bytes (installed by default) ...
Im using the following code in Python v2.5.4:
self.sck = socket( AF_INET, SOCK_STREAM )
self.sck.setsockopt( IPPROTO_TCP, TCP_NODELAY, 1 )
self.sck.connect( ( "127.0.0.1", "12345" ) )
while( 1 ):
self.sck.send( "test\n" )
self.sck.send( "" )
Turning TCP_NODELAY on / off does not seem to have any effect ... Is this a bug or is something missing?
TIA
source
share