| Visual Basic (Declaration) | |
|---|---|
Public Function New() | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As New Tcp() | |
| C# | |
|---|---|
public Tcp() | |
| Managed Extensions for C++ | |
|---|---|
public: Tcp(); | |
| C++/CLI | |
|---|---|
public: Tcp(); | |
The following example demonstrates creating a Tcp object.
| Visual Basic | Copy 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(); | |
The default constructor initializes a new Tcp class.
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 |
Target Platforms: Microsoft .NET Framework 2.0