Share via


ConnectionDroppedEventArgs

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

ConnectionDroppedEventArgs

The ConnectionDroppedEventArgs class defines the object returned by the ServerAgent.ConnectionDropped event.

The ConnectionDroppedEventArgs class is derived from the System.EventArgs class.

Public Constructors

The ConnectionDroppedEventArgs class has the following public constructor.

Constructor

Description

ConnectionDroppedEventArgs.ConnectionDroppedEventArgs (ConnectionDroppedReason)

Creates a new instance of the ConnectionDroppedEventArgs class, with a ConnectionDroppedReason value indicating the reason for the dropped connection.

Public Methods

The ConnectionDroppedEventArgs class has the following public methods.

Method

Description

Equals(Object)

Inherited from System.Object. Determines whether the specified System.Object is equal to the current System.Object.

GetHashCode()

Inherited from System.Object. Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.

GetType()

Inherited from System.Object. Gets the System.Type of the current instance.

ToString()

Inherited from System.Object. Returns a System.String that represents the current System.Object.

Public Properties

The ConnectionDroppedEventArgs class has the following public property.

Property

Description

ConnectionDroppedEventArgs.Reason

Data type: ConnectionDroppedReasonAccess type: Read-only

Contains a ConnectionDroppedReason enumeration value indicating the reason for the dropped connection.

Example Code

The following code sample demonstrates simple logic for handling a dropped connection event.

// ...
ServerAgent mySA = new ServerAgent(this, myAppManifest);
mySA.ConnectionDropped += new ConnectionDroppedEventHandler(OnConnectionDropped);

// ...

// Event handler for ConnectionDropped events.
public void OnConnectionDropped(object sender, ConnectionDroppedEventArgs cdeArgs)
{
// ...
switch (cdeArgs.Reason)
{
case ConnectionDroppedReason.ApplicationDisabled:
  Console.Writeline("The application has been disabled on the Office Communications Server.");
  break;
case ConnectionDroppedReason.ApplicationDisconnected:
  Console.WriteLine("The application has been disconnected from the Office Communications Server.");
  break;
case ConnectionDroppedReason.ApplicationReconnectTimeout:
  Console.WriteLine("The application timed out while attempting to reconnect to the Office Communications Server.");
  break;
case ConnectionDroppedReason.ServerAgentDisposed:
  Console.WriteLine("The ServerAgent instance for this application had Dispose called on it.");
  break;
case ConnectionDroppedReason.ServerShutdown:
  Console.WriteLine("The Office Communications Server was shut down unexpectedly.");
  break;
default:
  Console.WriteLine("The connection to the Office Communications Server was dropped for unknown reason.");
  break;
}
}

Requirements

Redistributable: Requires Microsoft Office Communications Server 2007 R2.

Namespace:Microsoft.Rtc.Sip

Assembly: ServerAgent (in ServerAgent.dll)

See Also

Concepts

ConnectionDroppedEventHandler

ConnectionDroppedReason

ServerAgent.ConnectionDropped