See Also

Dart.PowerTCP.SslSockets Namespace

Requirements

Namespace: Dart.PowerTCP.SslSockets

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: Dart.PowerTCP.SslSockets (in Dart.PowerTCP.SslSockets.dll)

Language

Visual Basic

C#

C++

C++/CLI

Show All

sender
The source of the event.
e
A DatagramEventArgs object that contains the event data.
See Also Requirements Languages PowerTCP SSL Sockets for .NET

DatagramEventHandler Delegate

Dart.PowerTCP.SslSockets Namespace : DatagramEventHandler Delegate

Represents the method (event handler) that is raised when data is received or sent.

[Visual Basic]
Public Delegate Sub DatagramEventHandler( _    ByVal sender As Object, _    ByVal e As DatagramEventArgs _ )
[C#]
public delegate void DatagramEventHandler(    object sender,    DatagramEventArgs e );
[C++]
public: __gc __delegate void DatagramEventHandler(    Object* sender,    DatagramEventArgs* e )
[C++/CLI]
public delegate void DatagramEventHandler(    Object^ sender,    DatagramEventArgs^ e )

Parameters

sender
The source of the event.
e
A DatagramEventArgs object that contains the event data.

Remarks

As Microsoft describes in their MSDN documentation, the event model in the .NET Framework is based on having an event delegate that connects an event with its handler. To raise an event, two elements are needed:

When sending or receiving data, the class that holds the event data is the DatagraEventArgs class. A method must be created with the same signature as the delegate. In this example that would mean a method would have to be defined to accept two arguments (an object and a DatagramEventArgs) and return void. Once this has been done, the delegate must be "connected" to the handling event. This is done by adding an instance of the delegate to the event.

For more information about event handler delegates, see the Using Events In PowerTCP topic.

If your code causes an exception, it would be returned to the handling event without you seeing it. To preclude such a condition, you should ALWAYS use a try/catch block around your event-handling code.

Requirements

Namespace: Dart.PowerTCP.SslSockets

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: Dart.PowerTCP.SslSockets (in Dart.PowerTCP.SslSockets.dll)

See Also

Dart.PowerTCP.SslSockets Namespace


Send comments on this topic.

Documentation version 1.1.2.0.

© 2008 Dart Communications.  All rights reserved.