Setting TCP_QUICKACK for iOS socket

Hello everyone,


I'm using TCP socket for communication between devices in my apps. So far I've been experiencing a latency problem with sending/receiving messages via the socket. According to this topic here http://www.stuartcheshire.org/papers/nagledelayedack/ , the problem might probably due to Nagle Algorithm and Delay ACK.


After some research, I'm able to set TCP_NODEDELAY for my socket by using this code:


int nodelay_flag = 1;

setsockopt(*sock, IPPROTO_TCP, TCP_NODELAY, (void*) &nodelay_flag, sizeof(int))


However I still cannot disable Delay ACK. I'm told that TCP_QUICKACK will solve the problem, but when I write this code:


int quickack_flag = 1;

setsockopt(*sock, IPPROTO_TCP, TCP_QUICKACK, (void*) &quickack_flag, sizeof(int))


I got the error from compiler error: "Use of undeclared identifier 'TCP_QUICKACK' ".
Can someone please help me with this? Thanks a lot in advance.

TCP_QUICKACK
is not available on iOS. If you’d like to see such support added in the future, I encourage you to file an enhancement request describing your requirements.

Please post your bug number, just for the record.

ps BSD Sockets is considered a compatibility API on iOS, and we encourage folks to use Network framework for low-level networking. Enhancements like this are likely to show up there, and then be ported to the BSD Sockets API only if it’s absolutely necessary.

On the plus side, Network framework is a lot nicer to call from Swift (-:

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Seeing select() take up to 200ms or more because of this. This then hitches our game since we're trying to communicate with a remote manager. I tried setting TCP_NODELAY to no effect to fix this. So must also need TCP_QUICKACK but that's not defined. Since OSX was as BSD OS, it seems odd that this is missing and that full support isn't there.

I probably can't share links on this forum, but this is the issue.

  1. Nagle's Algorithm and Delayed ACK Do Not Play Well Together in a TCP/IP Network

Hello guys Reviving this thread to understand if there is support for this socket option in macOS. If not, is there a possibility for Apple to provide this?

Setting TCP_QUICKACK for iOS socket
 
 
Q