Used in relation to events occurring within the scope of a connection. The SecurityCallback is used when information is required for authentication.
The callback used for security has to exist for the lifetime of the connection. If this callback has a lifetime that is less than that of the object it is associated with, some unexpected errors within the client can occur. For example, you can keep the SecurityCallback as a global variable, or create the callback object on the heap and destroy it after the associated connection is closed.