The C++ framework for developing highly scalable, high performance servers on Windows platforms.

CSimpleNamedPipeServer Class Reference
[Interprocess Communication]

Inheritance diagram for CSimpleNamedPipeServer:
Collaboration diagram for CSimpleNamedPipeServer:

List of all members.


Detailed Description

A wrapper around the Named Pipe API which makes it easy to manage named pipe servers. The pipes created are read/write, overlapped, message oriented pipes.


Public Member Functions

 CSimpleNamedPipeServer (const Core::_tstring &name, DWORD numInstances=1, DWORD bufferSize=1024, Milliseconds defaultTimeout=5000)
 Create a named pipe server for a pipe with the specified name, instances and buffer size.
 CSimpleNamedPipeServer (const CSimpleNamedPipeServer &rhs)
CSimpleNamedPipeServeroperator= (const CSimpleNamedPipeServer &rhs)
bool Connect (Core::COverlapped &overlapped) const
 Accept a connection to a pipe instance. Returns true if an instance is connected and false if the asynchronous connection acceptance is still in progress (use the overlapped object to wait on the connection acceptance completion).
void Disconnect () const
 Disconnects the named pipe.
bool Send (const void *pSendBuffer, DWORD sendBufferSize, Core::COverlapped &overlapped) const
 Send the data in the supplied buffer using the supplied COverlapped object for overlapped I/O notifications.
bool Receive (void *pReceiveBuffer, DWORD receiveBufferSize, Core::COverlapped &overlapped, DWORD *pBytesReceived) const
 Receive from the pipe into the supplied buffer using the supplied COverlapped object for overlapped I/O notifications.
bool SendAndReceive (const void *pSendBuffer, DWORD sendBufferSize, void *pReceiveBuffer, DWORD receiveBufferSize, Core::COverlapped &overlapped, DWORD *pBytesReceived) const
 Send the supplied send buffer and receive a response from the pipe into the receive buffer using the COverlapped object for overlapped I/O notifications.
DWORD GetOverlappedResult (Core::COverlapped &overlapped) const
 Call GetOverlappedResult on the supplied COverlapped object using the pipe's HANDLE and returns the number of bytes transferred. Throws an exception on failure.
bool CancelIo () const

Protected Attributes

CSmartHandle m_handle


Constructor & Destructor Documentation

CSimpleNamedPipeServer ( const Core::_tstring name,
DWORD  numInstances = 1,
DWORD  bufferSize = 1024,
Milliseconds  defaultTimeout = 5000 
) [explicit]

Create a named pipe server for a pipe with the specified name, instances and buffer size.


Member Function Documentation

CSimpleNamedPipeServer& operator= ( const CSimpleNamedPipeServer rhs  ) 

bool Connect ( Core::COverlapped overlapped  )  const

Accept a connection to a pipe instance. Returns true if an instance is connected and false if the asynchronous connection acceptance is still in progress (use the overlapped object to wait on the connection acceptance completion).

void Disconnect (  )  const

Disconnects the named pipe.

bool Send ( const void *  pSendBuffer,
DWORD  sendBufferSize,
Core::COverlapped overlapped 
) const [inherited]

Send the data in the supplied buffer using the supplied COverlapped object for overlapped I/O notifications.

bool Receive ( void *  pReceiveBuffer,
DWORD  receiveBufferSize,
Core::COverlapped overlapped,
DWORD pBytesReceived 
) const [inherited]

Receive from the pipe into the supplied buffer using the supplied COverlapped object for overlapped I/O notifications.

bool SendAndReceive ( const void *  pSendBuffer,
DWORD  sendBufferSize,
void *  pReceiveBuffer,
DWORD  receiveBufferSize,
Core::COverlapped overlapped,
DWORD pBytesReceived 
) const [inherited]

Send the supplied send buffer and receive a response from the pipe into the receive buffer using the COverlapped object for overlapped I/O notifications.

DWORD GetOverlappedResult ( Core::COverlapped overlapped  )  const [inherited]

Call GetOverlappedResult on the supplied COverlapped object using the pipe's HANDLE and returns the number of bytes transferred. Throws an exception on failure.

bool CancelIo (  )  const [inherited]


Member Data Documentation

CSmartHandle m_handle [protected, inherited]


Generated on Sun Sep 12 19:11:48 2021 for The Server Framework - v7.4 by doxygen 1.5.3