CFSocketConnectToAddress(_:_:_:)
Opens a connection to a remote socket.
Declaration
func CFSocketConnectToAddress(_ s: CFSocket!, _ address: CFData!, _ timeout: CFTimeInterval) -> CFSocketErrorParameters
- s:
The CFSocket object with which to connect to
address. - address:
A CFData object containing a
struct sockaddrappropriate for the protocol family ofs(struct sockaddr_inorstruct sockaddr_in6, for example), indicating the remote address to which to connect. This data object is used only for the duration of the function call. - timeout:
The time to wait for a connection to succeed. If a negative value is used, this function does not wait for the connection and instead lets the connection attempt happen in the background. If
srequested akCFSocketConnectCallBack, you will receive a callback when the background connection succeeds or fails.
Return Value
An error code indicating success or failure of the connection attempt.