IrcDotNet.IrcClient.Disconnect C# (CSharp) Method

Disconnect() public method

Disconnects asynchronously from the server.
This method closes the client connection immediately and forcibly, and does not send a quit message to the server. To disconnect from the IRC server gracefully, call Quit(string) and wait for the connection to be closed.
The current instance has already been disposed.
public Disconnect ( ) : void
return void
        public virtual void Disconnect()
        {
            CheckDisposed();
        }

Usage Example

コード例 #1
0
ファイル: Program.cs プロジェクト: serverkomplex/IrcDotNet
        private static void HandleEventLoop(IrcDotNet.IrcClient client)
        {
            bool isExit = false;

            while (!isExit)
            {
                Console.Write("> ");
                var command = Console.ReadLine();
                switch (command)
                {
                case "exit":
                    isExit = true;
                    break;

                default:
                    if (!string.IsNullOrEmpty(command))
                    {
                        if (command.StartsWith("/") && command.Length > 1)
                        {
                            client.SendRawMessage(command.Substring(1));
                        }
                        else
                        {
                            Console.WriteLine("unknown command '{0}'", command);
                        }
                    }
                    break;
                }
            }
            client.Disconnect();
        }
All Usage Examples Of IrcDotNet.IrcClient::Disconnect
IrcClient