Dart.PowerTCP.EmailValidation Namespace : Segment Class (Dart.PowerTCP.EmailValidation) |
Provides a reference to a data segment where data is sent or received over a TCP stream.
For a list of all members of this type, see Segment members.
System.Object
Dart.PowerTCP.EmailValidation.Segment
[Visual Basic]
Public Class Segment
[C#]
public class Segment
[C++]
public __gc class Segment
[C++/CLI]
public ref class Segment
When data is sent or received when using the Tcp component (which may be by using the Tcp component directly, or by using another component that uses the Tcp component for the underlying connection), a Segment object is returned. This Segment object will contain data such as the data sent or received and the amount of bytes sent or received. To use the data, simply access the Segment.Buffer property using the offset specified by the Segment.Offset property. As a shortcut, the Segment.ToString method can be used to simply return all data sent or received as a string.
The Segment object is also used by other components beside the Tcp component. For example, several components have a Trace event which allows access to any data sent or received over the control connection. A SegmentEventArgs class is made accessible in this event, containing a Segment object describing the data sent or received.
The following example demonstrates connecting to a server while specifying a local interface to use.
[Visual Basic]
' Connect to the server, specifying the local interface to use
Tcp1.Connect("atropos", 13, "192.168.0.83", 8888)
' Since connection was to DAYTIME port (13), simply receive the time
Dim seg As Segment = Tcp1.Receive()
Debug.WriteLine("Time reported by server: " + seg.ToString())
[C#]
// Connect to the server, specifying the local interface to use
tcp1.Connect("atropos", 13, "192.168.0.83", 8888);
// Since connection was to DAYTIME port (13), simply receive the time
Segment seg =
tcp1.Receive();
Debug.WriteLine("Time reported by server: " + seg.ToString());
Namespace: Dart.PowerTCP.EmailValidation
Platforms: Windows 98, Windows NT 4.0, Windows ME, Windows 2000, Windows XP, Windows Server 2003, Windows Vista
Assembly: Dart.PowerTCP.EmailValidation (in Dart.PowerTCP.EmailValidation.dll)
Segment Members | Dart.PowerTCP.EmailValidation Namespace
Send comments on this topic.
Documentation version 1.0.3.0.
© 2008 Dart Communications. All rights reserved.