How to set tcp_nodelay in GCDAsyncsocket?
Seems like the title is self descriptive. I want to increase the speed of sending and receiving data in my app and i was told to set tcp_nodelay to true. But i have no idea how to do that with GCDAsyncSocket. Can anyone help me? I haven't used GCDAsyncSocket , but "GCDAsyncSocket.h" shows that you can get the underlying socket descriptor with the socketFD method, which must be called only in a performBlock: call. So the following code might work: [asyncSocket performBlock:^{ int fd = [asyncSocket socketFD]; int on = 1; if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char*)&on, sizeof(on)) == -1)