ConnectToServer
This method connects the client to the WebSocket server using the URI specified in the serverUri variable.
await ChatClient.ConnectToServer();try
{
await ChatClient.ConnectToServer();
Console.WriteLine("Connected to server.");
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}Last updated