Partager via


ConnectionDroppedEventArgs class

 
Microsoft Office Live Communications Server 2005 with SP1

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(ConnectionDroppedReason reason)

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
Reason Data type: ConnectionDroppedReason
Access 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 Live Communications Server.");
		  break;
		case ConnectionDroppedReason.ApplicationDisconnected:
		  Console.WriteLine("The application has been disconnected from the Live Communications Server.");
		  break;
		case ConnectionDroppedReason.ApplicationReconnectTimeout:
		  Console.WriteLine("The application timed out while attempting to reconnect to the Live 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 Live Communications Server was shut down unexpectedly.");
		  break;
		default:
		  Console.WriteLine("The connection to the Live Communications Server was dropped for unknown reason.");
		  break;
	}
}

Requirements

Redistributable: Requires Microsoft Office Live Communications Server 2005 with SP1.
Namespace: Microsoft.Rtc.Sip
Assembly: ServerAgent (in ServerAgent.dll)

See Also

ConnectionDroppedEventHandler, ConnectionDroppedReason, ServerAgent.ConnectionDropped

  
  What did you think of this topic?
  © 2008 Microsoft Corporation. All rights reserved.