Client
Namespace: TagBites.Net
Assembly: TagBites.Net.dll
Product: TagBites.Net v. 1.0.3
TCP client which allows to send objects messages and execute remote methods. This class is thread safe.
public class Client : TagBites.Net.NetworkClientInheritance: object → NetworkClient → Client
Constructors
Section titled “Constructors”Client(string, int)
Section titled “Client(string, int)”Initializes a new instance of the Client class.
public Client(string host, int port)Parameters
Section titled “Parameters”hoststring
Address on which server is listening for clients.portint
Port on which server is listening for clients.
Client(string, int, NetworkConfig)
Section titled “Client(string, int, NetworkConfig)”Initializes a new instance of the Client class.
public Client(string host, int port, NetworkConfig config)Parameters
Section titled “Parameters”hoststring
Address on which server is listening for clients.portint
Port on which server is listening for clients.configNetworkConfig
Network configuration.
Client(string, int, ClientCredentials)
Section titled “Client(string, int, ClientCredentials)”Initializes a new instance of the Client class.
public Client(string host, int port, ClientCredentials credentials)Parameters
Section titled “Parameters”hoststring
Address on which server is listening for clients.portint
Port on which server is listening for clients.credentialsClientCredentials
Client credentials used for authentication.
Client(string, int, ClientCredentials, NetworkConfig)
Section titled “Client(string, int, ClientCredentials, NetworkConfig)”Initializes a new instance of the Client class.
public Client(string host, int port, ClientCredentials credentials, NetworkConfig config)Parameters
Section titled “Parameters”hoststring
Address on which server is listening for clients.portint
Port on which server is listening for clients.credentialsClientCredentials
Client credentials used for authentication.configNetworkConfig
Network configuration.
Client(IPEndPoint)
Section titled “Client(IPEndPoint)”Initializes a new instance of the Client class.
public Client(IPEndPoint address)Parameters
Section titled “Parameters”addressIPEndPoint
Address on which server is listening for clients.
Client(IPEndPoint, NetworkConfig)
Section titled “Client(IPEndPoint, NetworkConfig)”Initializes a new instance of the Client class.
public Client(IPEndPoint address, NetworkConfig config)Parameters
Section titled “Parameters”addressIPEndPoint
Address on which server is listening for clients.configNetworkConfig
Network configuration.
Client(IPEndPoint, ClientCredentials)
Section titled “Client(IPEndPoint, ClientCredentials)”Initializes a new instance of the Client class.
public Client(IPEndPoint address, ClientCredentials credentials)Parameters
Section titled “Parameters”addressIPEndPoint
Address on which server is listening for clients.credentialsClientCredentials
Client credentials used for authentication.
Client(IPEndPoint, ClientCredentials, NetworkConfig)
Section titled “Client(IPEndPoint, ClientCredentials, NetworkConfig)”Initializes a new instance of the Client class.
public Client(IPEndPoint address, ClientCredentials credentials, NetworkConfig config)Parameters
Section titled “Parameters”addressIPEndPoint
Address on which server is listening for clients.credentialsClientCredentials
Client credentials used for authentication.configNetworkConfig
Network configuration.
Properties
Section titled “Properties”RemoteEndPoint
Section titled “RemoteEndPoint”Gets the remote endpoint.
public EndPoint RemoteEndPoint { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”ConnectAsync()
Section titled “ConnectAsync()”Starts the connection.
public Task ConnectAsync()Returns
Section titled “Returns”ConnectSslAsync()
Section titled “ConnectSslAsync()”Starts the SSL connection.
public Task ConnectSslAsync()Returns
Section titled “Returns”ConnectSslAsync(string)
Section titled “ConnectSslAsync(string)”Starts the SSL connection.
public Task ConnectSslAsync(string serverName)Parameters
Section titled “Parameters”serverNamestring
Name of the server (used for certificate validation).
Returns
Section titled “Returns”OnConnected()
Section titled “OnConnected()”Invokes Connected event.
protected virtual void OnConnected()OnControllerResolve(object, NetworkConnectionControllerResolveEventArgs)
Section titled “OnControllerResolve(object, NetworkConnectionControllerResolveEventArgs)”Invokes ControllerResolve event.
protected virtual void OnControllerResolve(object sender, NetworkConnectionControllerResolveEventArgs e)Parameters
Section titled “Parameters”OnValidateServerCertificate(object, X509Certificate, X509Chain, SslPolicyErrors)
Section titled “OnValidateServerCertificate(object, X509Certificate, X509Chain, SslPolicyErrors)”Validates server certificate.
protected virtual bool OnValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)Parameters
Section titled “Parameters”senderobjectcertificateX509CertificatechainX509ChainsslPolicyErrorsSslPolicyErrors
Returns
Section titled “Returns”Use<TControllerInterface, TController>()
Section titled “Use<TControllerInterface, TController>()”Registers a local controller. The instance is created on first use.
public void Use()Type Parameters
Section titled “Type Parameters”TControllerInterface
Controller interface.TController
Controller type.
Use<TControllerInterface, TController>(TController)
Section titled “Use<TControllerInterface, TController>(TController)”Registers an already created local controller.
public void Use(TController controller)Type Parameters
Section titled “Type Parameters”TControllerInterface
Controller interface.TController
Controller type.
Parameters
Section titled “Parameters”controllerTController
Controller instance.
Events
Section titled “Events”Connected
Section titled “Connected”Occurs after connection is established to the server and client is authenticated.
public EventHandler Connected