connection.h
This file includes the type definition for a connection structure, representing a client connected to an OpenTok session, along with several function declarations related to client connections.
Includes: config.h, base.h
typedef otc_connection
Type definition for a structure representing a client connected to an OpenTok session.
typedef struct otc_connection otc_connection;
Functions
| Name | Description |
|---|---|
otc_connection_get_id(connection) → {const char *} |
Returns the unique identifier for this connection. |
otc_connection_get_creation_time(connection) → {int64_t} |
Returns the timestamp for when the client connected to the OpenTok session. |
otc_connection_get_data(connection) → {const char *} |
Returns the data associated with the connection. |
otc_connection_get_session_id(connection) → {const char *} |
Gets the session ID for the session the connection is connected to. |
otc_connection_copy(connection) → {otc_connection *} |
Makes a copy of this connection. |
otc_connection_delete(connection) → {otc_status} |
Releases resources associated with the connection. |
otc_connection_get_id(connection) → {const char *}
Returns the unique identifier for this connection.
Parameters:
| Name | Type | Description |
|---|---|---|
connection |
const otc_connection * | The client connection. |
Returns:
The unique identifier for this connection.
otc_connection_get_creation_time(connection) → {int64_t}
Returns the timestamp for when the client connected to the OpenTok session.
Parameters:
| Name | Type | Description |
|---|---|---|
connection |
const otc_connection * | The client connection. |
Returns:
The time when the client connected to the OpenTok session.
otc_connection_get_data(connection) → {const char *}
Returns the data associated with the connection. You set this data when you create the token used for by the client to connect to the OpenTok session. See the Token Creation Overview developer guide.
Parameters:
| Name | Type | Description |
|---|---|---|
connection |
const otc_connection * | The client connection. |
Returns:
The connection data.
otc_connection_get_session_id(connection) → {const char *}
Gets the session ID for the session the connection is connected to.
Parameters:
| Name | Type | Description |
|---|---|---|
connection |
const otc_connection * | The client connection. |
Returns:
The session ID for the session.
otc_connection_copy(connection) → {otc_connection *}
Makes a copy of this connection.
Parameters:
| Name | Type | Description |
|---|---|---|
connection |
const otc_connection * | The client connection to be copied |
Returns:
A copy of the connection. It is set to null if there is an error.
otc_connection_delete(connection) → {otc_status}
Releases resources associated with the connection.
Parameters:
| Name | Type | Description |
|---|---|---|
connection |
otc_connection * | The client connection to release. |
Returns:
Return value indicating either error or success.