DCMTK Version 3.7.0 OFFIS DICOM Toolkit

Public Member Functions | List of all members
OFIPCMessageQueueClient Class Reference

a client class for one-directional IPC messaging. More...

## Public Member Functions
| OFIPCMessageQueueClient ()
| default constructor
virtual | ~OFIPCMessageQueueClient ()
| destructor, will implicitly call closeQueue() if not already called by the user.
OFCondition | openQueue (const char *name, Uint32 port)
| open (access) an existing message queue More...
OFBool | hasQueue () const
| check if this object manages an open message queue More...
OFCondition | closeQueue ()
| close the message queue More...
void | detachQueue ()
| resets this object to default constructed state without closing the message queue. More...
OFCondition | sendMessage (const OFString &msg)
| send a message by placing it into the message queue. More...

## Detailed Description

a client class for one-directional IPC messaging.

It enables the user to access an existing IPC message queue and to send messages to that queue.

Note
  Note that there are platform specific limits to the message queue implementation depending on the underlying operating system API used. For example, Posix message queues on Linux only permit a maximum of 10 messages in the queue, and a maximum of 255 open queues system-wide. System V message queues on Linux only permit a maximum of 8 kBytes of data in a message queue. Furthermore, there are also limits on the maximum message size. For portable usage, messages should be text-based and short (e.g. a DICOM UID), and message queues should be kept short.

## Member Function Documentation

## ◆ closeQueue()

OFCondition OFIPCMessageQueueClient::closeQueue | ( |  | ) |

close the message queue

Returns
  EC_Normal if successful, an error code otherwise

## ◆ detachQueue()

void OFIPCMessageQueueClient::detachQueue | ( |  | ) |

resets this object to default constructed state without closing the message queue.

This method may be called by forked child processes to make sure that the destructor executed in the child process will not close the message queue for the parent process as well.

## ◆ hasQueue()

OFBool OFIPCMessageQueueClient::hasQueue | ( |  | ) | const

check if this object manages an open message queue

Returns
  true if message queue is open, false otherwise

## ◆ openQueue()

OFCondition OFIPCMessageQueueClient::openQueue | ( | const char * | name,
|  | Uint32 | port
| ) |  |

open (access) an existing message queue

Parameters

  a | name for the queue that is known both to the client and the server. Typically the name of the tool using the queue. Must not contain characters that are not permitted in a filename. Should not be longer than 128 bytes.
  a | number that is known both to the client and the server. Usually this will be the port number under which the server process accepts incoming TCP/IP network connection. When used in other contexts, a number larger than 65535 should be used.

Returns
  EC_Normal if successful, an error code otherwise

## ◆ sendMessage()

OFCondition OFIPCMessageQueueClient::sendMessage | ( | const OFString & | msg | ) |

send a message by placing it into the message queue.

Parameters

  msg | the message to be sent. Note that there are platform specific limitations to the maximum message size, e.g. 8 kByte per message for Posix message queues on Linux and 4 kByte per message for System V message queues on Linux. In general, messages should be short.

Returns
  EC_Normal if successful, an error code otherwise

The documentation for this class was generated from the following file:

- ofstd/include/dcmtk/ofstd/ofipc.h

Generated on Mon Dec 15 2025 for DCMTK Version 3.7.0 by Doxygen 1.9.1