CFSocketSetAddress(_:_:)
Binds a local address to a CFSocket object and configures it for listening.
Declaration
func CFSocketSetAddress(_ s: CFSocket!, _ address: CFData!) -> CFSocketErrorParameters
- s:
The CFSocket object to modify.
- address:
A CFData object containing a
struct sockaddrappropriate for the protocol family ofs(struct sockaddr_inorstruct sockaddr_in6, for example). This data object is used only for the duration of the function call.
Return Value
An error code indicating success or failure.
Discussion
This function binds the socket by calling bind, and if the socket supports it, configures the socket for listening by calling listen with a backlog of 256.
Once s is bound to address, depending on the socket’s protocol, other processes and computers can connect to s.