winss
|
Base named pipe server. More...
#include <pipe_server.hpp>
Public Member Functions | |
PipeServer (const PipeServerConfig &config) | |
Create a new pipe instance with the given config. More... | |
PipeServer (const PipeServer &)=delete | |
No copy. More... | |
PipeServer (PipeServer &&)=delete | |
No move. More... | |
virtual bool | IsAccepting () const |
Gets if the pipe server is accepting a new connection. More... | |
virtual bool | IsStopping () const |
Gets if the pipe server is stopping. More... | |
virtual size_t | InstanceCount () const |
Gets the current instance count. More... | |
PipeServer & | operator= (const PipeServer &)=delete |
No copy. More... | |
PipeServer & | operator= (PipeServer &&)=delete |
No move. More... | |
virtual | ~PipeServer () |
Disconnect all clients and close all connections. More... | |
Protected Member Functions | |
void | StartClient () |
Open a new named pipe for a new client to connect to. More... | |
void | Stop () |
Stop the pipe server. More... | |
void | Triggered (const winss::HandleWrapper &handle) |
The event handler for the pipe server. More... | |
virtual void | Connected (TPipeInstance *instance) |
Called when a client is connected. More... | |
virtual void | Triggered (TPipeInstance *instance) |
Called when an event is triggered. More... | |
Protected Attributes | |
bool | stopping = false |
Flag if the server is stopping. More... | |
bool | open = false |
Flag if the server is open for connections. More... | |
std::map< winss::HandleWrapper, TPipeInstance > | instances |
A mapping of handles to instances. More... | |
winss::NotOwningPtr< winss::WaitMultiplexer > | multiplexer |
The event multiplexer for the named pipe server. More... | |
winss::PipeName | pipe_name |
The name of the pipe. More... | |
Base named pipe server.
This class should be specialized as a inbound or outbound pipe server.
TPipeInstance | The named pipe instance implementation. |
|
inlineexplicit |
Create a new pipe instance with the given config.
config | The pipe server config. |
References winss::WaitMultiplexer::AddInitCallback(), and winss::WaitMultiplexer::AddStopCallback().
|
delete |
No copy.
|
delete |
No move.
|
inlinevirtual |
Disconnect all clients and close all connections.
|
inlineprotectedvirtual |
Called when a client is connected.
instance | The associated client instance. |
|
inlinevirtual |
Gets the current instance count.
|
inlinevirtual |
Gets if the pipe server is accepting a new connection.
|
inlinevirtual |
Gets if the pipe server is stopping.
|
delete |
No copy.
|
delete |
No move.
|
inlineprotected |
Open a new named pipe for a new client to connect to.
References winss::WaitMultiplexer::AddTriggeredCallback().
|
inlineprotected |
Stop the pipe server.
|
inlineprotected |
The event handler for the pipe server.
handle | The handle that triggered the event. |
References winss::WaitMultiplexer::AddTriggeredCallback(), winss::REMOVE, and winss::SKIP.
|
inlineprotectedvirtual |
Called when an event is triggered.
instance | The associated client instance. |
|
protected |
A mapping of handles to instances.
|
protected |
The event multiplexer for the named pipe server.
|
protected |
Flag if the server is open for connections.
|
protected |
The name of the pipe.
|
protected |
Flag if the server is stopping.