// // IProtocolLogger.cs // // Author: Jeffrey Stedfast // // Copyright (c) 2013-2020 .NET Foundation and Contributors // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // using System; namespace MailKit { /// /// An interface for logging the communication between a client and server. /// /// /// An interface for logging the communication between a client and server. /// /// /// /// public interface IProtocolLogger : IDisposable { /// /// Logs a connection to the specified URI. /// /// /// Logs a connection to the specified URI. /// /// The URI. /// /// is null. /// /// /// The logger has been disposed. /// /// /// An I/O error occurred. /// void LogConnect (Uri uri); /// /// Logs a sequence of bytes sent by the client. /// /// /// Logs a sequence of bytes sent by the client. /// is called by the upon every successful /// write operation to its underlying network stream, passing the exact same , /// , and arguments to the logging function. /// /// The buffer to log. /// The offset of the first byte to log. /// The number of bytes to log. /// /// is null. /// /// /// is less than zero or greater than the length of . /// -or- /// The is not large enough to contain bytes strting /// at the specified . /// /// /// The logger has been disposed. /// /// /// An I/O error occurred. /// void LogClient (byte[] buffer, int offset, int count); /// /// Logs a sequence of bytes sent by the server. /// /// /// Logs a sequence of bytes sent by the server. /// is called by the upon every successful /// read of its underlying network stream with the exact buffer that was read. /// /// The buffer to log. /// The offset of the first byte to log. /// The number of bytes to log. /// /// is null. /// /// /// is less than zero or greater than the length of . /// -or- /// The is not large enough to contain bytes strting /// at the specified . /// /// /// The logger has been disposed. /// /// /// An I/O error occurred. /// void LogServer (byte[] buffer, int offset, int count); } }