.Net client

🔗 install package from nuget

Add required namespace

using TcpClientKit;

Set connection event.

TcpClient.ConnectResult += (TcpClient.ConnectingStatus cs) =>
{
    Console.WriteLine(cs);                
};

Add listeners

Client.On("Login", LoginResult);

login sample function

private void Login(string data)
{
    Console.WriteLine($"{data} from Login");
}

Initialize and Start client

TcpClient.InitServer("127.0.0.1", 3000);

we try to connect to server with IP 127.0.0.1 and port 3000

For reconnecting

Client.CloseConnection();
TcpClient.InitServer("127.0.0.1", 3000);