Пример #1
0
        //********************************************************************
        /// <summary> Function used to disconnect from the server </summary>
        public void Disconnect()
        {
            LogLib.WriteLine("Entering in CSocketClient.Disconnect()", LogLevel.Trace);

            // Close down the connection
            if (GetNetworkStream != null)
            {
                GetNetworkStream.Close();
            }

            if (GetTcpClient != null)
            {
                GetTcpClient.Close();
            }

            if (GetClientSocket != null)
            {
                GetClientSocket.Close();
            }

            // Clean up the connection state
            GetClientSocket  = null;
            GetNetworkStream = null;
            GetTcpClient     = null;

            LogLib.WriteLine("Exiting in CSocketClient.Disconnect()", LogLevel.Trace);
        }
Пример #2
0
        //********************************************************************
        /// <summary> Function used to disconnect from the server </summary>
        public void Disconnect()
        {
            // Close down the connection
            GetNetworkStream?.Close();

            GetTcpClient?.Close();

            GetClientSocket?.Close();

            // Clean up the connection state
            GetClientSocket  = null;
            GetNetworkStream = null;
            GetTcpClient     = null;
        }
Пример #3
0
 //********************************************************************
 /// <summary> Function used to disconnect from the server </summary>
 public void Disconnect()
 {
     // Close down the connection
     GetNetworkStream?.Close();
     GetTcpClient?.Close();
 }