# MTSessionServer

MTSessionServer is the interface that retrieves and creates sessions.

## Program ID

MetraPipeline.MTSessionServer.1

## MTSessionServer Methods

GetSession | Returns a particular session, based on the session ID.
CreateSessionSet | Returns a session set, based on the session ID.
GetSessionSet | Gets a session set, based on the session ID.
Init | Initializes the shared memory that holds the session state information.
GetSessionWithUID | Returns the session identified by the unique ID (UID).

## MTSessionServer Properties

PercentUsed | Returns the current percent used of the shared memory file. Percent used is defined as the max percent full of all the shared memory pools.
CurrentCapacity | Returns the current capacity of the shared memory file. Capacity is the maximum percent full of all the shared memory pools. Deprecated, use PercentUsed instead.

## Example

Example to be provided in a future release of this online help system.

# Method Detail

## GetSession

Returns a particular session, based on the session ID.

### Visual Basic Syntax

Function GetSession(SessionID As Long) As MTSession

### C++ Syntax

HRESULT GetSession (long sessionId, [out,retval] IMTSession * * session) ;

### Arguments

sessionID

ID of the session to retrieve.

### Return Value

A pointer to the new session.

## CreateSessionSet

Returns a session set, based on the session ID.

### Visual Basic Syntax

Function CreateSessionSet() As MTSessionSet

### C++ Syntax

HRESULT CreateSessionSet ( [out, retval] IMTSessionSet * * apSet) ;

### Return Value

A pointer to the new session set.

## GetSessionSet

Returns a session set, based on the session ID.

### Visual Basic Syntax

Function GetSessionSet(setId As Long) As MTSessionSet

### C++ Syntax

HRESULT GetSessionSet (long setId, [out, retval] IMTSessionSet * * apSet) ;

### Arguments

setID

The set ID to find.

### Return Value

A pointer to the session set that has been retrieved.

## Init

Initializes the shared memory that holds the session state information.

### Visual Basic Syntax

Sub Init(filename As String, sharename As String, totalSize As Long)

### C++ Syntax

HRESULT Init (BSTR filename, BSTR sharename, long totalSize) ;

### Arguments

filename

The name of the Memory-mapped file that holds session state information.

sharename

The name of the file mapping to use when accessing shared memory.

totalSize

The total size (in bytes) of the shared memory file.

## GetSessionWithUID

Returns the session identified by the unique ID (UID).

### Visual Basic Syntax

Function GetSessionWithUID(UID(0 To 15) As Byte) As MTSession

### C++ Syntax

HRESULT GetSessionWithUID ( [in] unsigned char uid[16] , [out, retval] IMTSession * * session) ;

### Arguments

uid

The unique ID of the session to find.

### Return Value

A pointer to the new session.

# Property Detail

## PercentUsed

Returns the percentage of space used for storing session data. Space used is defined as the max percent full of all the shared memory pools.

This is a read-only property.

### Visual Basic Syntax

Property PercentUsed As Double

### C++ Syntax

HRESULT PercentUsed([out, retval] double * pVal);

### Return Value

The current capacity of the pipeline.

## CurrentCapacity

Returns the current capacity of the shared memory file. Capacity is the maximum percent full of all the shared memory pools. Deprecated, use PercentUsed instead.

This is a read-only property.

### Visual Basic Syntax

Property CurrentCapacity As Double

### C++ Syntax

HRESULT CurrentCapacity ( [out, retval] double * pVal) ;

### Return Value

The current capacity of the pipeline.