示例#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();
 }