MumbleKit
 All Classes Functions
Instance Methods | List of all members
<MKConnectionDelegate> Protocol Referenceabstract

#import <MumbleKit/MKConnection.h>

Instance Methods

(void) - connectionOpened:
 
(void) - connection:unableToConnectWithError:
 
(void) - connection:closedWithError:
 
(void) - connection:trustFailureInCertificateChain:
 
(void) - connection:rejectedWithReason:explanation:
 

Detailed Description

MKConnectionDelegate implements a set of methods that are called on the delegate object of a MKConnection when important connection-related events happen.

Method Documentation

- (void) connection: (MKConnection *)  conn
closedWithError: (NSError *)  err 

This method is called whenever the connection is closed, be it by an error, or by disconnection. If the disconnection was caused by an error, the err parameter will be a non-nil value.

This method can only be called after the connection has been opened. If an error occurs during the connection phase, the method connection:unableToConnectWithError: will be called instead.

Parameters
connThe connection that was closed.
errThe error that caused the disconnection. (Nil if not caused by an error)
- (void) connection: (MKConnection *)  conn
rejectedWithReason: (MKRejectReason)  reason
explanation: (NSString *)  explanation 

The connection attempt was rejected. This could, for example, be an authentication failure.

Parameters
connThe MKConnection object whose connection was rejected.
reasonThe reason for the rejected connection attempt. (See MKRejectReason).
explanationA textual description of the reason for rejection.
- (void) connection: (MKConnection *)  conn
trustFailureInCertificateChain: (NSArray *)  chain 

This method is called if the MKConnection could not verify the TLS certificate chain of the remote server as trusted.

To implement support for self-signed certificates, one wold typically save the digest of the leaf certificate of the server's certificate chain somewhere along with host information for the server (hostname:port) that the trust failure happened on. Then, every time a connection attempt is made, the trust failure can then be remedied by setting setIgnoreSSLVerification property on the MKConnection and issuing a reconnect to the MKConnection object.

Parameters
connThe connection that the trust failure occurred on.
chainThe TLS certificate chain of the remote server. (An array of MKCertificate objects)
- (void) connection: (MKConnection *)  conn
unableToConnectWithError: (NSError *)  err 

This method is called if a connection cannot be stablished to the given server.

Parameters
connThe connection that this occurred in.
errError describing why the connection could not be established.
- (void) connectionOpened: (MKConnection *)  conn

This method is called once a connection has been established to the remote host, and the TLS handshake has finished. Once the MKConnection has sent this message to its delegate, it is safe to authenticate with the server.

Parameters
connThe connection that was opened.

The documentation for this protocol was generated from the following file: