Sends data over a CFSocket object.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Core Foundation
The CFSocket object to use.
The address, stored as a
struct sockaddrappropriate for the protocol family (
struct sockaddr, for example) in a CFData object, to which to send the contents of
NULL, the data are sent to the address to which
sis already connected. This data object is used only for the duration of the function call.
The data to send.
The time to wait for the data to be sent.
An error code indicating success or failure.
This function sets the send timeout of the underlying socket (the
SO option at the
SOL level), then calls send (or sendto if you provided an address) with the provided data.
This function makes no attempt to queue data for delivery beyond the queueing provided by the socket buffer itself. This means:
If this function returns
CFSocket, then by the time it returns, the data has been queued in the socket buffer for delivery.
If the socket buffer is full and the timeout is nonzero, the function may return an error. If this happens, the app should wait for the socket buffer to have enough space available for writing before calling this function again.