CFSocketCallBack
Callback invoked when certain types of activity takes place on a CFSocket object.
Declaration
typealias CFSocketCallBack = (CFSocket?, CFSocketCallBackType, CFData?, UnsafeRawPointer?, UnsafeMutableRawPointer?) -> VoidParameters
- s:
The CFSocket object that experienced some activity.
- callbackType:
The type of activity detected.
- address:
A CFData object holding the contents of a
struct sockaddrappropriate for the protocol family ofs(struct sockaddr_inorstruct sockaddr_in6, for example), identifying the remote address to whichsis connected. This value isNULLexcept forkCFSocketAcceptCallBackandkCFSocketDataCallBackcallbacks. - data:
Data appropriate for the callback type. For a
kCFSocketConnectCallBackthat failed in the background, it is a pointer to anSInt32error code; for akCFSocketAcceptCallBack, it is a pointer to a Cfsocketnativehandle; or for akCFSocketDataCallBack, it is a CFData object containing the incoming data. In all other cases, it isNULL. - info:
The
infomember of the Cfsocketcontext structure that was used when creating the CFSocket object.
Discussion
You specify this callback when you create the CFSocket object with CFSocketCreate(_:_:_:_:_:_:_:), CFSocketCreateConnectedToSocketSignature(_:_:_:_:_:_:), CFSocketCreateWithNative(_:_:_:_:_:), or CFSocketCreateWithSocketSignature(_:_:_:_:_:).