I am creating a socket tcp connection using CFStreamCreatePairWithSocketToHost
like this to get a write stream (I dont want to ready any data):
CFStreamCreatePairWithSocketToHost(NULL, (CFStringRef)host, port, NULL, &writeStream);
This works pretty well but because of the nagle's algorithm my tcp commands are buffered. This may be cool but in my case I need to send the command as fast as possible without any delays.
I found a way to disable this "feature" using the following code found here:
int yes = 1;
setsockopt(CFSocketGetNative(aSocket), IPPROTO_TCP, TCP_NODELAY, (void *)&yes, sizeof(yes));
but I cant figure out how to get a valid reference to my socket. Can you help me?