Thank You for the response.
QUOTE
Within Network framework, every connection has a send buffer [1]. That buffer has a high-water mark, that is, it's expected maximum size. When you send data on the connection, the system always adds the data to the buffer.
UNQUOTE
Rephrasing the above: The above statement mean that the NWConnection.send will always cause the data to gets copied into the 'send buffer', but if the copied location is above the high-water mark, it will defer the calling of the completion handler.
My previous understanding was that the copying to the send-buffer itself will be deferred. Hence wanted to clarify the doubt.
QUOTE From the document https://developer.apple.com/documentation/networkextension/handling-flow-copying
Buffering larger amounts of data can lead to memory problems. If the provider must buffer data, set an upper bound on the buffer and don’t read until the buffer has space to hold more data.
UNQUOTE
We are using UDP, and want to parallelize sending of multiple datagrams of a large message. Does the above statement in bold means that if the application wants to send multiple datagrams before waiting for a completion, the application should define a upper limit in term of size. Say if the application defines an upper limit of 16000 bytes, and given datagram of size 1000 bytes, then at most the application can have 16 pending send completion. Once the pending limit reaches 16 the application should defer further sends. Hence have a query here, what is the recommended basis of deciding on the buffer size for where parallelism is desired. Is there any function that can be used at runtime to know how many pending send completions or how much buffer size pending at a time is fine.