Class SessionService
The session service is responsible for connecting the SDK with the Dolby.io backend by opening and closing sessions.
To use the session service, follow these steps:
- Open a session using the OpenAsync(UserInfo) method.
- Join a conference using the ConferenceService.
- Leave the conference and close the session using the CloseAsync() method.
Inherited Members
Namespace: DolbyIO.Comms.Services
Assembly: DolbyIO.Comms.Sdk.dll
Syntax
public sealed class SessionService
Examples
try
{
UserInfo user = new UserInfo();
user.Name = "Some Name";
user = await _sdk.Session.OpenAsync(user);
}
catch (DolbyIOException e)
{
// Error handling
}
Properties
| Improve this Doc View SourceIsOpen
Gets if a session is currently open.
Declaration
public bool IsOpen { get; }
Property Value
Type | Description |
---|---|
Boolean |
|
User
Gets the local participant object that belongs to the current session.
Declaration
public UserInfo User { get; }
Property Value
Type | Description |
---|---|
UserInfo | The UserInfo class that contains information about the participant who opened the session. |
Methods
| Improve this Doc View SourceCloseAsync()
Closes the current session.
Declaration
public async Task CloseAsync()
Returns
Type | Description |
---|---|
Task | A Task that represents the asynchronous operation. |
OpenAsync(UserInfo)
Opens a new session for the specified participant.
Declaration
public async Task<UserInfo> OpenAsync(UserInfo user)
Parameters
Type | Name | Description |
---|---|---|
UserInfo | user | Information about the participant who opens the session. |
Returns
Type | Description |
---|---|
Task<UserInfo> | The Task<TResult> that represents the asynchronous open operation. The Result property returns the UserInfo object representing the participant who opened the session. |