Receiving an incoming session involves the following steps:
- Registering with an endpoint for the SessionReceived
events.
- Implementing an event handler to handle the incoming session
dispatched from a SessionReceived event.
Registering for SessionReceived Events
The following code example shows how to register with an endpoint to receive SessionReceived events.
Copy Code | |
---|---|
RealTimeEndpoint endpoint = ...; // Assumed to be created elsewhere endpoint.SessionReceived += new EventHandler<SessionReceivedEventArgs>(OnSessionReceived); |
Handling the Event to Receive an Incoming Session
The following code example shows how to implement a handler for the SessionReceived event.
Copy Code | |
---|---|
void OnSessionReceived(object sender, SessionReceivedEventArgs e) { SignalingSession session = e.Session; // Additional code } |
In production code, you should examine the session headers to ensure that the correct session is received.