INtime SDK Help
ntxAttachRtPort

Enables an application to monitor several ports simultaneously by attaching ordinary ports to a sink port. An ordinary port can be attached only to one sink port, and they must reside on the same host. After attachment, any message sent to the port specified as the source port is automatically forwarded to the port specified as the sink port. Both sink and source ports must be for the same service.

After you attach a port to a sink port, all subsequent messages to the ordinary port are forwarded to the sink port. Messages queued at the ordinary port at the time of attachment are not forwarded to the sink port, so make sure the queue is empty before attaching the sink port. A thread queued to receive a message at an ordinary port with an empty message queue remains in the task queue until it times out or until the sink port is detached and a message arrives at the ordinary port.

Only a single level of forwarding is supported; a sink port may not be attached to another sink port.

NTXSTATUS ntxAttachRtPort(
    NTXHANDLE hPort,
    NTXHANDLE hSinkPort
);

Parameters

hPort
The port from which messages are forwarded.
hSinkPort
The port to which messages are forwarded.

Return Values

E_OK
Success.
The appropriate status code.
Failure. To determine the status, call ntxGetLastRtError.

Status

E_OK 0x0000
No exceptional conditions occurred.
E_EXIST 0x0006
Either the hPort or the hSinkPort parameter does not refer to an existing object.
E_STATE 0x0007
The port is already attached to another sink port.
E_TYPE 0x8002
Either the port parameter or the sink port parameter is not the handle of the correct type.
E_LOCATION
The RT client on which the port was created is now invalid.
E_NTX_INTERNAL_ERROR
The DLL could not contact the RT kernel to complete the request.

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/nt/include/ntx.h ntx.h ntx.lib
INtime 4.01 (for 64-bit Windows) intime/nt/include/ntx.h ntx.h ntx64.lib

See Also

Port system calls,