to test connecting:
try
{
}
catch
{
}
to connect/reconnect:
TcpClient tcpClient;
private void ConnectToServer(string ServerIP, int ServerPort)
{
tcpClient = new TcpClient();
try
{
tcpClient.Connect(ServerIP, ServerPort);
}
catch (Exception exMessage)
{
}
}