Receiving an incoming session involves the following steps:

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.

See Also

Concepts

Creating an Outgoing Signaling Session

Other Resources

Creating a Real-Time Endpoint