Yaircc.Net.IRC.Connection.SendCallback C# (CSharp) Method

SendCallback() private method

Handles the outgoing data callback of the under lying socket.
private SendCallback ( IAsyncResult result ) : void
result IAsyncResult Represents the status of the asynchronous operation.
return void
        private void SendCallback(IAsyncResult result)
        {
            try
            {
                NetworkStream stream = this.client.GetStream();

                // If the network stream is closed an ObjectDisposedException will be thrown
                // in the thread that EndWrite executes on, causing the global exception handle
                // to be invoked and result in yaircc crashing, so we must first check to see
                // if we explicitly can write to the network stream.
                if (stream.CanWrite)
                {
                    stream.EndWrite(result);
                }
            }
            catch (ObjectDisposedException)
            {
            }
            catch (InvalidOperationException)
            {
            }
        }