Edit

Share via


ServerAgent Class

Definition

Implements the server agent.

public ref class ServerAgent : IDisposable
public class ServerAgent : IDisposable
Public Class ServerAgent
Implements IDisposable
Inheritance
ServerAgent
Implements

Remarks

Applications use ServerAgent objects to interact with the server. Each object of this class represents a logical SIP application to the server, and the server to the application. Most applications will only create one such object, but in special cases, it may be necessary to create multiple server agent objects (for example, logging all incoming and all outgoing messages). In order to terminate interaction with the server, applications should call the Dispose() method.

Constructors

ServerAgent(ApplicationManifest)

Simplified version of the constructor for use by script-only applications.

ServerAgent(Object, ApplicationManifest)

Creates a new server agent for the supplied application object and with the supplied application maifest.

Properties

ActiveWorkerThreads

Returns the number of worker threads currently executing inside ProcessEvent.

InsideRtcHost

Indicates whether the server agent is running inside RTCHost.exe. Not intended for third-party developers.

MessagesInServerAgent

Returns the number of messages correctly contained in ServerAgent's state manager.

Role

The current server role.

ServerFqdn

The server's machine FQDN

ServerPool

The name of the pool to which the server belongs.

ServerProcess

Server process.

SPLLoggerPresent

SPL Logger present

WaitHandle

Internal handle used to signal that there is pending input from the SIP server that the server agent needs to process.

Methods

AddAuthorizedHost(Guid, String, Boolean, Boolean, Boolean, Boolean, Boolean)
CheckDisposed()

Throws an ObjectDisposedException if the object is in the disposed state.

Cleanup()

Clean up function to clear static state. Supports RtcHost infrastructure, not intended for third-party developers.

CloseHandle(IntPtr)

The CloseHandle method closes an open Microsoft Windows object handle.

Dispose()

Releases all resources used by this object.

Dispose(Boolean)

Releases the unmanaged resources used by this object and optionally releases the managed resources.

Finalize()

Finalizer of an instance for this class.

OnConnectionDropped(ConnectionDroppedReason)

Raises the ConnectionDropped event.

ProcessEvent(Object)

Dequeues an event from the server queue and processes it.

ProcessEventOnThreadPool()

Dequeues events from the server queue and processes them on ThreadPool thread. This method takes into account the number of active worker threads before queuing events on threadpool.

RemoveAuthorizedHost(Guid)

Removes an entry from the authorized host table

WaitForServerAvailable(Int32)

Waits for the RTCSRV process to startup.

Events

AuthorizedHostOperationCompleted

Occurs when Add/RemoveAuthorizedHost operations complete.

ConnectionDropped

Occurs when the connection to the server has been dropped. For example, when the server has crashed.

UnhandledException

Occurs when an unhandled exception is caught by the ServerAgent dispatcher. The application can return true to allow the process to continue or false to cause the exception to be re-thrown.

Applies to