using DiscordRPC.Logging; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace DiscordRPC.IO { /// /// Pipe Client used to communicate with Discord. /// public interface INamedPipeClient : IDisposable { /// /// The logger for the Pipe client to use /// ILogger Logger { get; set; } /// /// Is the pipe client currently connected? /// bool IsConnected { get; } /// /// The pipe the client is currently connected too /// int ConnectedPipe { get; } /// /// Attempts to connect to the pipe. If 0-9 is passed to pipe, it should try to only connect to the specified pipe. If -1 is passed, the pipe will find the first available pipe. /// /// If -1 is passed, the pipe will find the first available pipe, otherwise it connects to the pipe that was supplied /// bool Connect(int pipe); /// /// Reads a frame if there is one available. Returns false if there is none. This should be non blocking (aka use a Peek first). /// /// The frame that has been read. Will be default(PipeFrame) if it fails to read /// Returns true if a frame has been read, otherwise false. bool ReadFrame(out PipeFrame frame); /// /// Writes the frame to the pipe. Returns false if any errors occur. /// /// The frame to be written bool WriteFrame(PipeFrame frame); /// /// Closes the connection /// void Close(); } }