PowerTCP Mail for .NET
Offset Property
See Also  Send comments on this topic.
Dart.PowerTCP.Mail Namespace > Segment Class : Offset Property




The offset into the buffer.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property Offset As Integer
Visual Basic (Usage)Copy Code
Dim instance As Segment
Dim value As Integer
 
value = instance.Offset
C# 
public int Offset {get;}
Managed Extensions for C++ 
public: __property int get_Offset();
C++/CLI 
public:
property int Offset {
   int get();
}

Property Value

An integer representing the offset into the buffer.

Example

The following example demonstrates connecting to a server while specifying a local interface to use.
Visual BasicCopy Code
' 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#Copy Code
// 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());

Remarks

Use this property to access offset parameter of the Receive and Send methods.

When using the Tcp component, using Tcp.Send or Tcp.Receive will return a Segment object. The buffer offset is available through Segment.Offset.

When using the Udp component, using Udp.Send or Udp.Receive will return a Datagram object. The buffer offset is available through Datagram.Offset.

Use this property to properly access the data available in Segment.Buffer or Datagram.Buffer.

When using other PowerTCP components, a Segment or Datagram object (which one depends on if TCP or UDP is used as the transport protocol) is made available to describe data sent or received, often in a Trace event. The Segment.Offset or Datagram.Offset property contains the offset into the buffer.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

Documentation Version 3.2
© 2010 Dart Communications. All Rights Reserved.