PowerTCP Mail for .NET
Tcp Constructor(Socket)
See Also  Example Send comments on this topic.
Dart.PowerTCP.Mail Namespace > Tcp Class > Tcp Constructor : Tcp Constructor(Socket)




acceptedSocket
The System.Net.Sockets.Socket to use for the underlying connection.
Initializes a new instance of the Tcp class, specifying the System.Net.Sockets.Socket to use for the underlying connection.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal acceptedSocket As Socket _
)
Visual Basic (Usage)Copy Code
Dim acceptedSocket As Socket
 
Dim instance As New Tcp(acceptedSocket)
C# 
public Tcp( 
   Socket acceptedSocket
)
Managed Extensions for C++ 
public: Tcp( 
   Socket* acceptedSocket
)
C++/CLI 
public:
Tcp( 
   Socket^ acceptedSocket
)

Parameters

acceptedSocket
The System.Net.Sockets.Socket to use for the underlying connection.

Example

The following example demonstrates creating a Tcp object.
Visual BasicCopy Code
' Declare as class member
Friend WithEvents Tcp1 As Tcp

' Create in class initialization
Me.Tcp1 = New Tcp()
C#Copy Code
private Tcp tcp1 = new Tcp();

Remarks

Use this constructor create an instance of the Tcp class using an already created Socket. Typically, this is used when a connection is made on a socket that is listening for connections.

To create an instance of the Tcp component using Visual Studio.NET, simply add the Tcp component to the form and the object will automatically be created and initialized. If working out of the Visual Studio.NET environment (or using the Tcp component as a reference), the Tcp component will have to be explicitly created and initialized.

The following table shows initial property values for an instance of Tcp.

Property Initial Value
Tcp.Available 0
Tcp.Charset Default system charset (accessible via System.Text.Encoding.Default.BodyName)
Tcp.Connected false
Tcp.DoEvents true
Tcp.KeepAlive false
Tcp.LocalEndPoint reference to System.Net.IPEndPoint
Tcp.NoDelay false
Tcp.OutOfBandInline false
Tcp.Proxy reference to Dart.PowerTCP.Proxy
Tcp.ReceiveBufferSize 8192
Tcp.ReceiveTimeout 0
Tcp.RemoteEndPoint reference to System.Net.IPEndPoint
Tcp.ReuseAddress false
Tcp.SendBufferSize 8192
Tcp.SendTimeout 0
Tcp.Socket null
Tcp.State null
Tcp.Stream SegmentedStream object

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

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