This class is a mechanism for reading control messages from a named pipe. Use start to spawn a thread that handles messages arriving at the pipe, and shutdown to stop reading. stop blocks until the processing thread has been terminated by a call to shutdown (either before stop is called, or from some other thread).

Synopsis

Declared in <balb_pipecontrolchannel.h>

class PipeControlChannel;

Type Aliases

Name

Description

ControlCallback

This type of function is called to handle control messages received on the pipe. The message is one complete message read from the pipe, without the terminating newline character.

Member Functions

Name

Description

PipeControlChannel [constructor]

Constructors

~PipeControlChannel [destructor]

Destroy this object. Shut down the processing thread if it is still running and block until it terminates. Close the named pipe and clean up any associated system resources.

allocator

Return the allocator used by this object to supply memory. Note that if no allocator was supplied at construction the default allocator in effect at construction is used.

permissions

Return the permission bit mask that will be applied to the named pipe on the next call to start.

pipeName

Return the fully qualified system name of the pipe.

setPermissions

Set the permission bit mask for the underlying named pipe to the specified permissions value. The behavior is undefined unless bdls::FilePermissions::isValidBaseBits(permissions). This setting only takes effect on the next call to start; calling this method has no effect on a pipe that has already been opened. See the class‐level documentation for a description of the cross‐platform semantics. The behavior is undefined if this method is called while the background thread is running (i.e., after start and before shutdown), or if the permissions value is not valid.

shutdown

Stop reading from the pipe and dispatching messages. If the background thread has begun processing a message, this method will block until a message that is currently being processed completes.

start

start overloads

stop

Block until the background thread has been terminated by a call to shutdown. Then close the pipe and clean up the associated file.

Static Data Members

Name

Description

k_DEFAULT_PERMISSIONS

The default permission bit mask for the underlying named pipe (read/write for owner, group, and others).

Created with MrDocs