See Also

SegmentedStream Class  | SegmentedStream Members  | Overload List

Requirements

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

Language

Visual Basic

C#

C++

C++/CLI

Show All

stream
The source stream to Read/Write.
See Also Languages PowerTCP SSL Sockets for .NET

SegmentedStream Constructor(Stream)

Dart.PowerTCP.SslSockets Namespace > SegmentedStream Class > SegmentedStream Constructor : SegmentedStream Constructor(Stream)

Initializes a new instance of the SegmentedStream class for the specified stream object.

[Visual Basic]
Public Function New( _    ByVal stream As Stream _ )
[C#]
public SegmentedStream(    Stream stream );
[C++]
public: SegmentedStream(    Stream* stream )
[C++/CLI]
public: SegmentedStream(    Stream^ stream )

Parameters

stream
The source stream to Read/Write.

Remarks

Although any type of stream can be used to initialize a SegmentedStream (a FileStream or a MemoryStream, for example) the intended use is to initialize a SegmentedStream with some form of network stream (such as a TcpStream). You will not usually need to create a SegmentedStream object, as the SegmentedStream object currently accessing the TCP stream is made accessible (either as a property of the component, or as an object accessible in an event or returned from a method). For example, if you wish to send/receive data to/from a server using a stream interface, simply use Tcp.Connect to connect to the server and call Tcp.Stream.Write or Tcp.Stream.Read to send/receive data.

Example

The following example demonstrates initializing a new instance of a SegmentedStream object to a TcpStream.

[Visual Basic] 

' Connect to a server
Tcp1.Connect("atropos", 7)

' Initialize a SegmentedStream to the NetworkStream
Dim sstream As New SegmentedStream(new TcpStream(Tcp1))

' Send data
sstream.Write("hello")

' Receive data
Dim s As String = sstream.Read()

[C#] 


// Connect to a server
tcp1.Connect("atropos", 7);

// Initialize a SegmentedStream to the NetworkStream
SegmentedStream sstream = new SegmentedStream(new TcpStream(tcp1));

// Send data
sstream.Write("hello");

// Receive data
string s = sstream.Read();
                

Requirements

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

See Also

SegmentedStream Class  | SegmentedStream Members  | Overload List


Send comments on this topic.

Documentation version 1.1.2.0.

© 2008 Dart Communications.  All rights reserved.