CFSocketInvalidate(_:)
Invalidates a CFSocket object, stopping it from sending or receiving any more messages.
Declaration
func CFSocketInvalidate(_ s: CFSocket!)Parameters
- s:
The CFSocket object to invalidate.
Discussion
You should always invalidate a socket object when you are through using it. Invalidating a CFSocket object prevents the object from sending or receiving any more messages, but does not release the socket object itself.
If a run loop source was created for s, the run loop source is invalidated.
If a release callback was specified in CFSocketContext object, this function calls it to release the object in the info field (which was provided when s was created).
By default, this call closes the underlying socket. If you have explicitly cleared the kCFSocketCloseOnInvalidate flag by calling CFSocketSetSocketFlags(_:_:), you must close the socket yourself after calling this function.