TcpClient

Overview

The TCPClient Class provides client connections for TCP (Transmission Control Protocol) network services.

Location

 

constructor

 

constructor

 

TcpClient()

 

Sub New()

BindingV4    (declared in Client)

Gets the binding which provides properties and methods such as address family, IPv4 address, port number etc for client to connect to the host network.

 

property BindingV4: Binding read;

 

Binding BindingV4 { get; }

 

ReadOnly Property BindingV4() As Binding

BindingV6    (declared in Client)

Gets the binding which provides properties and methods such as address family, IPv6 address, port number etc for client to connect to the host network.

 

property BindingV6: Binding read;

 

Binding BindingV6 { get; }

 

ReadOnly Property BindingV6() As Binding

Connect    (declared in Client)

 

method Connect: Connection

 

Connection Connect()

 

Function Connect() As Connection

Connect (IPAddress, Int32): Connection    (declared in Client)

 

method Connect(host: IPAddress; port: Int32): Connection

 

Connection Connect(IPAddress host, Int32 port)

 

Function Connect(host As IPAddress, port As Int32) As Connection

Parameters:

  • host:
  • port:

Connect (String, Int32): Connection    (declared in Client)

 

method Connect(hostname: String; port: Int32): Connection

 

Connection Connect(String hostname, Int32 port)

 

Function Connect(hostname As String, port As Int32) As Connection

Parameters:

  • hostname:
  • port:

Connect (IPAddress, Int32, Binding): Connection    (declared in Client)

Overloaded. Use to connect the client to a remote network host using the specified host name (HostName) or IP address (HostAddress) and port number (Port) and/or Binding (BindingV4 or BindingV6).

 

class method Connect(host: IPAddress; port: Int32; binding: Binding): Connection

 

static Connection Connect(IPAddress host, Int32 port, Binding binding)

 

Shared Function Connect(host As IPAddress, port As Int32, binding As Binding) As Connection

Parameters:

  • host:
  • port:
  • binding:

Connect (String, Int32, Binding): Connection    (declared in Client)

Overloaded. Use to connect the client to a remote network host using the specified host name (HostName) or IP address (HostAddress) and port number (Port) and/or Binding (BindingV4 or BindingV6).

 

class method Connect(hostname: String; port: Int32; binding: Binding): Connection

 

static Connection Connect(String hostname, Int32 port, Binding binding)

 

Shared Function Connect(hostname As String, port As Int32, binding As Binding) As Connection

Parameters:

  • hostname:
  • port:
  • binding:

ConnectionClass    (declared in Client)

Use the ConnectionClass property to specify an alternative Connection class to be used for out coming data connections. The class described by the assigned Type must be a descendant of Connection, and will be used for all connections that are established after the property has been set. Existing connections are not affected by changing the property.

If ConnectionType is null (default), instances of the Connection base class will be used.

 

property ConnectionClass: Type read write;

 

Type ConnectionClass { get; set; }

 

Property ConnectionClass() As Type

ConnectionFactory    (declared in Client)

Represents an interface for a connection.

 

property ConnectionFactory: IConnectionFactory read write;

 

IConnectionFactory ConnectionFactory { get; set; }

 

Property ConnectionFactory() As IConnectionFactory

ConnectionPool  protected    (declared in Client)

 

property ConnectionPool: ConnectionPool read write;

 

ConnectionPool ConnectionPool { get; set; }

 

Property ConnectionPool() As ConnectionPool

ConnectNew (IPAddress, Int32): Connection    (declared in Client)

Overloaded. Opens and returns new connection with specified IP address and port.

 

method ConnectNew(host: IPAddress; port: Int32): Connection

 

Connection ConnectNew(IPAddress host, Int32 port)

 

Function ConnectNew(host As IPAddress, port As Int32) As Connection

Parameters:

  • host:
  • port:

ConnectNew (String, Int32): Connection    (declared in Client)

 

method ConnectNew(hostname: String; port: Int32): Connection

 

Connection ConnectNew(String hostname, Int32 port)

 

Function ConnectNew(hostname As String, port As Int32) As Connection

Parameters:

  • hostname:
  • port:

DnsResolveType    (declared in Client)

Determines if the specified HostName should be look up only Once per application run (if you establish multiple connections to the server, the subsequent connections will use the cached IPAddress) or Always, for each connect (the Hostname will be resolved again for each subsequet connect).

You'll usually only change this setting off the defaut (Once) if you anticipate the IPAddress of the target host to change frequently.

 

property DnsResolveType: DnsResolveType read write;

 

DnsResolveType DnsResolveType { get; set; }

 

Property DnsResolveType() As DnsResolveType

EnableNagle    (declared in Client)

Set its value to true to enable the Nagle algorithm for send coalescing.

 

property EnableNagle: Boolean read write;

 

Boolean EnableNagle { get; set; }

 

Property EnableNagle() As Boolean

GetConnection  protected    (declared in Client)

 

method GetConnection(host: IPAddress; port: Int32): Connection

 

Connection GetConnection(IPAddress host, Int32 port)

 

Function GetConnection(host As IPAddress, port As Int32) As Connection

Parameters:

  • host:
  • port:

GetDefaultConnectionPool  protected    (declared in Client)

 

method GetDefaultConnectionPool: ConnectionPool

 

ConnectionPool GetDefaultConnectionPool()

 

Function GetDefaultConnectionPool() As ConnectionPool

HostAddress    (declared in Client)

Gets or sets an Internet Protocol (IP) address.

 

property HostAddress: IPAddress read write;

 

IPAddress HostAddress { get; set; }

 

Property HostAddress() As IPAddress

HostName    (declared in Client)

The server host name or IP address that you intend the client to connect to.

 

property HostName: String read write;

 

String HostName { get; set; }

 

Property HostName() As String

NewConnection  protected    (declared in Client)

 

method NewConnection(binding: Binding): Connection

 

Connection NewConnection(Binding binding)

 

Function NewConnection(binding As Binding) As Connection

Parameters:

  • binding:

OnResolvedHostName    (declared in Client)

This event is fired after the hostname has been successfully resolved.

 

event OnResolvedHostName: EventHandler<ResolvedHostNameEventArgs>;

 

delegate EventHandler<ResolvedHostNameEventArgs> OnResolvedHostName()

 

Event OnResolvedHostName As EventHandler<ResolvedHostNameEventArgs>

OnResolveHostName    (declared in Client)

This event is fired before the Client attepts to resolve the sepcifed HostName to an IP address. It provides you with an option to perform the resolution yourself, obtain the IP address from an internal cache you're maintaing, or do some other processing (such as for example chaging the hostname to look up).

 

event OnResolveHostName: EventHandler<ResolveHostNameEventArgs>;

 

delegate EventHandler<ResolveHostNameEventArgs> OnResolveHostName()

 

Event OnResolveHostName As EventHandler<ResolveHostNameEventArgs>

Port    (declared in Client)

The server Port that you intend the client to connect to.

 

property Port: Int32 read write;

 

Int32 Port { get; set; }

 

Property Port() As Int32

ReleaseConnection  protected    (declared in Client)

 

method ReleaseConnection(connection: Connection)

 

void ReleaseConnection(Connection connection)

 

Sub ReleaseConnection(connection As Connection)

Parameters:

  • connection:

ResolveHostName  protected    (declared in Client)

 

method ResolveHostName

 

void ResolveHostName()

 

Sub ResolveHostName()

ResolveHostNameIfNeeded  protected    (declared in Client)

 

method ResolveHostNameIfNeeded

 

void ResolveHostNameIfNeeded()

 

Sub ResolveHostNameIfNeeded()

SslOptions    (declared in Client)

 

property SslOptions: SslConnectionFactory read write;

 

SslConnectionFactory SslOptions { get; set; }

 

Property SslOptions() As SslConnectionFactory

TriggerOnResolvedHostName  protected    (declared in Client)

 

method TriggerOnResolvedHostName(e: ResolvedHostNameEventArgs)

 

void TriggerOnResolvedHostName(ResolvedHostNameEventArgs e)

 

Sub TriggerOnResolvedHostName(e As ResolvedHostNameEventArgs)

Parameters:

  • e:

TriggerOnResolveHostName  protected    (declared in Client)

 

method TriggerOnResolveHostName(e: ResolveHostNameEventArgs)

 

void TriggerOnResolveHostName(ResolveHostNameEventArgs e)

 

Sub TriggerOnResolveHostName(e As ResolveHostNameEventArgs)

Parameters:

  • e:

UseConnectionPooling

 

property UseConnectionPooling: Boolean read write;

 

Boolean UseConnectionPooling { get; set; }

 

Property UseConnectionPooling() As Boolean

 

BindingV4    (declared in Client)

Gets the binding which provides properties and methods such as address family, IPv4 address, port number etc for client to connect to the host network.

 

property BindingV4: Binding read;

 

Binding BindingV4 { get; }

 

ReadOnly Property BindingV4() As Binding

BindingV6    (declared in Client)

Gets the binding which provides properties and methods such as address family, IPv6 address, port number etc for client to connect to the host network.

 

property BindingV6: Binding read;

 

Binding BindingV6 { get; }

 

ReadOnly Property BindingV6() As Binding

ConnectionClass    (declared in Client)

Use the ConnectionClass property to specify an alternative Connection class to be used for out coming data connections. The class described by the assigned Type must be a descendant of Connection, and will be used for all connections that are established after the property has been set. Existing connections are not affected by changing the property.

If ConnectionType is null (default), instances of the Connection base class will be used.

 

property ConnectionClass: Type read write;

 

Type ConnectionClass { get; set; }

 

Property ConnectionClass() As Type

ConnectionFactory    (declared in Client)

Represents an interface for a connection.

 

property ConnectionFactory: IConnectionFactory read write;

 

IConnectionFactory ConnectionFactory { get; set; }

 

Property ConnectionFactory() As IConnectionFactory

ConnectionPool  protected    (declared in Client)

 

property ConnectionPool: ConnectionPool read write;

 

ConnectionPool ConnectionPool { get; set; }

 

Property ConnectionPool() As ConnectionPool

DnsResolveType    (declared in Client)

Determines if the specified HostName should be look up only Once per application run (if you establish multiple connections to the server, the subsequent connections will use the cached IPAddress) or Always, for each connect (the Hostname will be resolved again for each subsequet connect).

You'll usually only change this setting off the defaut (Once) if you anticipate the IPAddress of the target host to change frequently.

 

property DnsResolveType: DnsResolveType read write;

 

DnsResolveType DnsResolveType { get; set; }

 

Property DnsResolveType() As DnsResolveType

EnableNagle    (declared in Client)

Set its value to true to enable the Nagle algorithm for send coalescing.

 

property EnableNagle: Boolean read write;

 

Boolean EnableNagle { get; set; }

 

Property EnableNagle() As Boolean

HostAddress    (declared in Client)

Gets or sets an Internet Protocol (IP) address.

 

property HostAddress: IPAddress read write;

 

IPAddress HostAddress { get; set; }

 

Property HostAddress() As IPAddress

HostName    (declared in Client)

The server host name or IP address that you intend the client to connect to.

 

property HostName: String read write;

 

String HostName { get; set; }

 

Property HostName() As String

Port    (declared in Client)

The server Port that you intend the client to connect to.

 

property Port: Int32 read write;

 

Int32 Port { get; set; }

 

Property Port() As Int32

SslOptions    (declared in Client)

 

property SslOptions: SslConnectionFactory read write;

 

SslConnectionFactory SslOptions { get; set; }

 

Property SslOptions() As SslConnectionFactory

UseConnectionPooling

 

property UseConnectionPooling: Boolean read write;

 

Boolean UseConnectionPooling { get; set; }

 

Property UseConnectionPooling() As Boolean

 

Connect (IPAddress, Int32, Binding): Connection    (declared in Client)

Overloaded. Use to connect the client to a remote network host using the specified host name (HostName) or IP address (HostAddress) and port number (Port) and/or Binding (BindingV4 or BindingV6).

 

class method Connect(host: IPAddress; port: Int32; binding: Binding): Connection

 

static Connection Connect(IPAddress host, Int32 port, Binding binding)

 

Shared Function Connect(host As IPAddress, port As Int32, binding As Binding) As Connection

Parameters:

  • host:
  • port:
  • binding:

Connect (String, Int32, Binding): Connection    (declared in Client)

Overloaded. Use to connect the client to a remote network host using the specified host name (HostName) or IP address (HostAddress) and port number (Port) and/or Binding (BindingV4 or BindingV6).

 

class method Connect(hostname: String; port: Int32; binding: Binding): Connection

 

static Connection Connect(String hostname, Int32 port, Binding binding)

 

Shared Function Connect(hostname As String, port As Int32, binding As Binding) As Connection

Parameters:

  • hostname:
  • port:
  • binding:

 

constructor

 

constructor

 

TcpClient()

 

Sub New()

Connect    (declared in Client)

 

method Connect: Connection

 

Connection Connect()

 

Function Connect() As Connection

Connect (IPAddress, Int32): Connection    (declared in Client)

 

method Connect(host: IPAddress; port: Int32): Connection

 

Connection Connect(IPAddress host, Int32 port)

 

Function Connect(host As IPAddress, port As Int32) As Connection

Parameters:

  • host:
  • port:

Connect (String, Int32): Connection    (declared in Client)

 

method Connect(hostname: String; port: Int32): Connection

 

Connection Connect(String hostname, Int32 port)

 

Function Connect(hostname As String, port As Int32) As Connection

Parameters:

  • hostname:
  • port:

ConnectNew (IPAddress, Int32): Connection    (declared in Client)

Overloaded. Opens and returns new connection with specified IP address and port.

 

method ConnectNew(host: IPAddress; port: Int32): Connection

 

Connection ConnectNew(IPAddress host, Int32 port)

 

Function ConnectNew(host As IPAddress, port As Int32) As Connection

Parameters:

  • host:
  • port:

ConnectNew (String, Int32): Connection    (declared in Client)

 

method ConnectNew(hostname: String; port: Int32): Connection

 

Connection ConnectNew(String hostname, Int32 port)

 

Function ConnectNew(hostname As String, port As Int32) As Connection

Parameters:

  • hostname:
  • port:

GetConnection  protected    (declared in Client)

 

method GetConnection(host: IPAddress; port: Int32): Connection

 

Connection GetConnection(IPAddress host, Int32 port)

 

Function GetConnection(host As IPAddress, port As Int32) As Connection

Parameters:

  • host:
  • port:

GetDefaultConnectionPool  protected    (declared in Client)

 

method GetDefaultConnectionPool: ConnectionPool

 

ConnectionPool GetDefaultConnectionPool()

 

Function GetDefaultConnectionPool() As ConnectionPool

NewConnection  protected    (declared in Client)

 

method NewConnection(binding: Binding): Connection

 

Connection NewConnection(Binding binding)

 

Function NewConnection(binding As Binding) As Connection

Parameters:

  • binding:

ReleaseConnection  protected    (declared in Client)

 

method ReleaseConnection(connection: Connection)

 

void ReleaseConnection(Connection connection)

 

Sub ReleaseConnection(connection As Connection)

Parameters:

  • connection:

ResolveHostName  protected    (declared in Client)

 

method ResolveHostName

 

void ResolveHostName()

 

Sub ResolveHostName()

ResolveHostNameIfNeeded  protected    (declared in Client)

 

method ResolveHostNameIfNeeded

 

void ResolveHostNameIfNeeded()

 

Sub ResolveHostNameIfNeeded()

TriggerOnResolvedHostName  protected    (declared in Client)

 

method TriggerOnResolvedHostName(e: ResolvedHostNameEventArgs)

 

void TriggerOnResolvedHostName(ResolvedHostNameEventArgs e)

 

Sub TriggerOnResolvedHostName(e As ResolvedHostNameEventArgs)

Parameters:

  • e:

TriggerOnResolveHostName  protected    (declared in Client)

 

method TriggerOnResolveHostName(e: ResolveHostNameEventArgs)

 

void TriggerOnResolveHostName(ResolveHostNameEventArgs e)

 

Sub TriggerOnResolveHostName(e As ResolveHostNameEventArgs)

Parameters:

  • e:

 

OnResolvedHostName    (declared in Client)

This event is fired after the hostname has been successfully resolved.

 

event OnResolvedHostName: EventHandler<ResolvedHostNameEventArgs>;

 

delegate EventHandler<ResolvedHostNameEventArgs> OnResolvedHostName()

 

Event OnResolvedHostName As EventHandler<ResolvedHostNameEventArgs>

OnResolveHostName    (declared in Client)

This event is fired before the Client attepts to resolve the sepcifed HostName to an IP address. It provides you with an option to perform the resolution yourself, obtain the IP address from an internal cache you're maintaing, or do some other processing (such as for example chaging the hostname to look up).

 

event OnResolveHostName: EventHandler<ResolveHostNameEventArgs>;

 

delegate EventHandler<ResolveHostNameEventArgs> OnResolveHostName()

 

Event OnResolveHostName As EventHandler<ResolveHostNameEventArgs>