This interface is used to manage a monitoring session.
interface ISession extends ${IDispatch} {
// Properties
readonly ${BytesTransferred}: number;
readonly ${Connection}: ${IConnection};
readonly ${CreationTime}: Date;
readonly ${DataSource}: string;
readonly ${Devices}: ${IDeviceCollection};
readonly ${Id}: number;
readonly ${Status}: SessionStatus;
// Methods
${Drop}(): void;
${Pause}(): void;
${Resume}(): void;
}
public interface ISession : ${IDispatch}
{
// Properties
ulong ${BytesTransferred} { get; }
${IConnection} ${Connection} { get; }
DateTime ${CreationTime} { get; }
string ${DataSource} { get; }
${IDeviceCollection} ${Devices} { get; }
ulong ${Id} { get; }
SessionStatus ${Status} { get; }
// Methods
void ${Drop}();
void ${Pause}();
void ${Resume}();
}
struct ISession : IDispatch
{
// Properties
unsigned __int64 ${BytesTransferred}; // get
${IConnectionPtr#IConnection} ${Connection}; // get
Date ${CreationTime}; // get
_bstr_t ${DataSource}; // get
${IDeviceCollectionPtr#IDeviceCollection} ${Devices}; // get
unsigned __int64 ${Id}; // get
SessionStatus ${Status}; // get
// Methods
HRESULT ${Drop}();
HRESULT ${Pause}();
HRESULT ${Resume}();
};
readonly BytesTransferred: number;
ulong BytesTransferred { get; }
unsigned __int64 BytesTransferred; // get
This property holds the total number of transferred bytes for the current session.
readonly Connection: ${IConnection};
${IConnection} Connection { get; }
${IConnectionPtr#IConnection} Connection; // get
This property returns a reference to a session's connection object.
readonly CreationTime: Date;
DateTime CreationTime { get; }
Date CreationTime; // get
This property holds the session creation time.
readonly DataSource: string;
string DataSource { get; }
_bstr_t DataSource; // get
Returns the type of the source for the current session. Can be Serial
, USB
or Network
.
readonly Devices: ${IDeviceCollection};
${IDeviceCollection} Devices { get; }
${IDeviceCollectionPtr#IDeviceCollection} Devices; // get
Returns a collection of session devices.
readonly Id: number;
ulong Id { get; }
unsigned __int64 Id; // get
This property holds a unique identifier of a session. This identifier is guaranteed to be unique for this server only.
readonly Status: SessionStatus;
SessionStatus Status { get; }
SessionStatus Status; // get
This property holds the current session status. It equals one or more of the following values:
Status | Value | Description |
---|---|---|
SessionDisconnected | 0x00000000 | A session has been disconnected. Session objects are never re-used. |
SessionPausedByClient | 0x00000001 | A session has been paused by the client. |
SessionPausedByServer | 0x00000002 | A session has been paused by the server. |
SessionRunning | 0x00000004 | A session is running. |
Drop(): void;
void Drop();
HRESULT Drop();
Disconnect the current session.
Pause(): void;
void Pause();
HRESULT Pause();
Pauses the session. ISession.Status property will have SessionPausedByServer
flag set after this method is called. Use the ISession.Resume method to resume the paused session.
Resume(): void;
void Resume();
HRESULT Resume();
Resumes a paused session. It removes the SessionPausedByServer
status, but cannot remove the SessionPausedByClient
status.