Get Started

TCDeviceDelegate Protocol Reference

Overview

TCDeviceDelegate is the delegate protocol for a TCDevice.

Tasks

Selector Description Type
–device:didStopListeningForIncomingConnections: TCDevice is no longer listening for incoming connections. Instance Method
–deviceDidStartListeningForIncomingConnections: TCDevice is now listening for incoming connections. Instance Method
–device:didReceiveIncomingConnection: Called when an incoming connection request has been received. At this point you choose to accept, ignore, or reject the new connection. Instance Method
–device:didReceivePresenceUpdate: Called when a presence update notification has been received. Instance Method

Instance Methods

device:didReceiveIncomingConnection:

Called when an incoming connection request has been received. At this point you choose to accept, ignore, or reject the new connection.

- (void)device:(TCDevice *)device didReceiveIncomingConnection:(TCConnection *)connection

Parameters
Name Description
device The TCDevice that is receiving the incoming connection request.
connection The TCConnection associated with the incoming connection. The incoming connection will be in the TCConnectionStatusPending state until it is either accepted or disconnected.
Discussion

Called when an incoming connection request has been received. At this point you choose to accept, ignore, or reject the new connection.

When this occurs, you should assign an appropriate TCConnectionDelegate on the TCConnection to properly respond to events.

Pending incoming connections may be received at any time, including while another connection is active. This method will be invoked once for each connection, and your code should handle this situation appropriately. A single pending connection can be accepted as long as no other connections are active; all other currently pending incoming connections will be automatically rejected by the library until the active connection is terminated.


device:didReceivePresenceUpdate:

Called when a presence update notification has been received.

- (void)device:(TCDevice *)device didReceivePresenceUpdate:(TCPresenceEvent *)presenceEvent

Parameters
Name Description
device The TCDevice that is receiving the presence update.
presenceEvent A TCPresenceEvent object describing the notification.
Discussion

Called when a presence update notification has been received.

When the device is ready, this selector (if implemented) is invoked once for each available client. Thereafter it is invoked as clients become available or unavailable.

A client is considered available even if another call is in progress.

Remember, when your client disconnects the [TCDeviceDelegate device:didStopListeningForIncomingConnections:] selector will be invoked, and when the device reconnects this presence selector will be called again for every available online client.


device:didStopListeningForIncomingConnections:

TCDevice is no longer listening for incoming connections.

- (void)device:(TCDevice *)device didStopListeningForIncomingConnections:(NSError *)error

Parameters
Name Description
device The TCDevice object that stopped listening.
error An NSError indicating the reason the TCDevice went offline. If the error is nil, this means that the incoming listener was successfully disconnected (for example, [TCDevice unlisten] was called)
Discussion

TCDevice is no longer listening for incoming connections.


deviceDidStartListeningForIncomingConnections:

TCDevice is now listening for incoming connections.

- (void)deviceDidStartListeningForIncomingConnections:(TCDevice *)device

Parameters
Name Description
device The TCDevice object that is now listening for connections.
Discussion

TCDevice is now listening for incoming connections.