fCraft.IRC.IrcThread.DisconnectThread C# (CSharp) Method

DisconnectThread() public method

public DisconnectThread ( [ quitMsg ) : void
quitMsg [
return void
            public void DisconnectThread([CanBeNull] string quitMsg) {
                if (isConnected && quitMsg != null) {
                    ClearLocalQueue();
                    Send(IRCCommands.Quit(quitMsg));
                } else {
                    isConnected = false;
                }
                IsReady = false;
                AssignBotForInputParsing();
                if (thread != null && thread.IsAlive) {
                    thread.Join(ThreadAbortTimeout);
                    if (thread.IsAlive) {
                        thread.Abort();
                    }
                }
                try {
                    if (reader != null) reader.Close();
                } catch (ObjectDisposedException) {}
                try {
                    if (writer != null) writer.Close();
                } catch (ObjectDisposedException) {}
                try {
                    if (client != null) client.Close();
                } catch (ObjectDisposedException) {}
            }