winss
|
A pipe instance for inbound client/server. More...
#include <pipe_instance.hpp>
Public Member Functions | |
InboundPipeInstance () | |
Creates a new outbound pipe instance. More... | |
InboundPipeInstance (const InboundPipeInstance &)=delete | |
No copy. More... | |
InboundPipeInstance (InboundPipeInstance &&instance) | |
Create a new inbound pipe instance and move from another. More... | |
bool | FinishRead () |
Finishes reading from the instance. More... | |
void | Read () |
Read from a pipe instance for events and data. More... | |
std::vector< char > | SwapBuffer () |
Swap the read buffer to be used by a listener. More... | |
InboundPipeInstance & | operator= (const InboundPipeInstance &)=delete |
No copy. More... | |
InboundPipeInstance & | operator= (InboundPipeInstance &&instance) |
Move an inbound pipe instance to this instance. More... | |
![]() | |
PipeInstance () | |
Creates a new pipe instance. More... | |
PipeInstance (const PipeInstance &)=delete | |
No copy. More... | |
PipeInstance (PipeInstance &&instance) | |
Create a new pipe instance from another. More... | |
virtual bool | IsPendingIO () const |
Gets if there is pending IO operations. More... | |
virtual bool | IsConnected () const |
Gets if the instance is connected. More... | |
virtual bool | IsClosing () const |
Gets if the instance is closing. More... | |
virtual winss::HandleWrapper | GetHandle () const |
Gets the event handle for the instance. More... | |
virtual bool | SetConnected () |
Sets the instance to connected state. More... | |
virtual OverlappedResult | GetOverlappedResult () |
Gets the last overlapped result of the instance. More... | |
virtual bool | CreateNamedPipe (const winss::PipeName &pipe_name) |
Creates the Windows named pipe server. More... | |
virtual bool | CreateFile (const winss::PipeName &pipe_name) |
Creates a Windows named pipe client. More... | |
virtual void | Closing () |
Marks the pipe instance as closing and triggers the event. More... | |
virtual void | DisconnectNamedPipe () |
DIsconnect the client from the pipe server. More... | |
virtual bool | Close () |
Close the pipe connection. More... | |
PipeInstance & | operator= (const PipeInstance &)=delete |
No copy. More... | |
PipeInstance & | operator= (PipeInstance &&instance) |
Move a pipe instance to this instance. More... | |
virtual | ~PipeInstance () |
Default destructor. More... | |
Additional Inherited Members | |
![]() | |
static const DWORD | kBufferSize = 4096 |
The pipe buffer. More... | |
static const DWORD | kTimeout = 5000 |
The pipe timeout. More... | |
![]() | |
bool | CheckError () |
Checks if error is a real error or pending IO operation. More... | |
![]() | |
OVERLAPPED | overlapped |
The overlapped structure. More... | |
HANDLE | handle = nullptr |
The event handle. More... | |
bool | connected = false |
Flags if the instance is connected. More... | |
bool | pending_io = false |
Flagged if IO event is pending. More... | |
bool | close = false |
Flagged if instance is closing. More... | |
std::vector< char > | buffer |
The instance byte buffer. More... | |
DWORD | bytes = 0 |
The bytes read or written. More... | |
A pipe instance for inbound client/server.
winss::InboundPipeInstance::InboundPipeInstance | ( | ) |
Creates a new outbound pipe instance.
|
delete |
No copy.
winss::InboundPipeInstance::InboundPipeInstance | ( | winss::InboundPipeInstance && | instance | ) |
Create a new inbound pipe instance and move from another.
instance | The inbound pipe instance to move from. |
bool winss::InboundPipeInstance::FinishRead | ( | ) |
Finishes reading from the instance.
References winss::PipeInstance::bytes, winss::PipeInstance::connected, and winss::PipeInstance::pending_io.
|
delete |
No copy.
winss::InboundPipeInstance & winss::InboundPipeInstance::operator= | ( | winss::InboundPipeInstance && | instance | ) |
Move an inbound pipe instance to this instance.
instance | The inbound pipe instance to move from. |
References winss::PipeInstance::operator=().
void winss::InboundPipeInstance::Read | ( | ) |
Read from a pipe instance for events and data.
References winss::PipeInstance::buffer, winss::PipeInstance::bytes, winss::PipeInstance::CheckError(), winss::PipeInstance::close, winss::PipeInstance::connected, winss::PipeInstance::handle, winss::PipeInstance::overlapped, winss::PipeInstance::pending_io, and WINDOWS.
std::vector< char > winss::InboundPipeInstance::SwapBuffer | ( | ) |
Swap the read buffer to be used by a listener.
References winss::PipeInstance::buffer, winss::PipeInstance::bytes, winss::PipeInstance::connected, and winss::PipeInstance::kBufferSize.