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.

  Copy imageCopy Code
// ...
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 Lync Server.");
  break;
case ConnectionDroppedReason.ApplicationDisconnected:
  Console.WriteLine("The application has been disconnected from Lync Server.");
  break;
case ConnectionDroppedReason.ApplicationReconnectTimeout:
  Console.WriteLine("The application timed out while attempting to reconnect to Lync Server.");
  break;
case ConnectionDroppedReason.ServerAgentDisposed:
  Console.WriteLine("The ServerAgent instance for this application had Dispose called on it.");
  break;
case ConnectionDroppedReason.ServerShutdown:
  Console.WriteLine("Lync Server was shut down unexpectedly.");
  break;
default:
  Console.WriteLine("The connection to Lync Server was dropped for unknown reason.");
  break;
}
}

Requirements

Redistributable: Requires Microsoft Lync Server 2010

Namespace:Microsoft.Rtc.Sip

Assembly: ServerAgent (in ServerAgent.dll)

See Also