IPCPortHandlerBase (open)

This objecttype is meant as a base for a message-handling script, and tries to abstract away the waiting on, receiving of and sending of messages as much as possible.

How to use it:

Open a listening port (eg using CreateIPCPort). Create an object based on the porthandlerbase, and give the port as argument. Call the Run member.

Messages will be dispatched to the OnMessage member. When processing just one message at a time, the reply can be sent by just returning the appropriate return value.

If you waiting loop needs to wait on other handles, or you need timeouts, you can override some other functions, to implement those.

In flat_responses mode, exceptions are given back as cell __exception Cells: what (string), trace (record array)

Syntax

LOADLIB "wh::ipc.whlib";

OBJECTTYPE IPCPortHandlerBase

Constructor

Properties

  • PROPERTY flat_responses

    If TRUE, no extra level [ success := TRUE, reply := ... ] is set in returned messages, and exceptions are integrated in messages (in cell __exception)

  • PROPERTY listenport

    IPC Port this handler listens on

Functions