INtime SDK Help
ntxReceiveRtDataXxx(INtimeDotNet)
INtime SDK v7 > About INtime > Alternate APIs > INtimeDotNet > ntxReceiveRtDataXxx(INtimeDotNet)

Waits for, and then copies, arbitrary data from an RT data mailbox.

Note:   If the NTX application must operate on data that contains RT Handles, you must convert the handles using ntxImportRtHandle. Also, see Handle conversion.

These functions correspond to the NTX function, ntxReceiveRtData. They receive respectively 1, 2 or 4 bytes, or a stream of bytes. The return value is the number of bytes actually received (NTX_ERROR is never returned). If the number returned is less than the number expected, the destination variable contains one or more undefined bytes. If the number of bytes received is more than the size of the destination variable, extra bytes are discarded.

Visual Basic:

Function ntxReceiveRtData1Byte(
  ByVal hMailbox As Integer,
  ByRef pMessage As Byte,
  ByVal dwMilliseconds As Integer)
As Short
Function ntxReceiveRtData2Bytes(
  ByVal hMailbox As Integer,
  ByRef pMessage As Short,
  ByVal dwMilliseconds As Integer)
As Short
Function ntxReceiveRtData4Bytes(
  ByVal hMailbox As Integer,
  ByRef pMessage As Integer,
  ByVal dwMilliseconds As Integer)
As Short
Function ntxReceiveRtDataBytes(
  ByVal hMailbox As Integer,
  ByVal pMessage () As Byte,
  ByVal dwMilliseconds As Integer,
  ByVal dMax As Integer)
As Short

Visual C#:

Int16 ntxReceiveRtData1Byte (
  Int32 hMailbox,
  ref Byte pMessage,
  Int32 dwMilliseconds );
Int16 ntxReceiveRtData2Bytes (
  nt32 hMailbox,
  ref Int16 pMessage,
  Int32 dwMilliseconds );
Int16 ntxReceiveRtData4Bytes (
  Int32 hMailbox,
  ref Int32 pMessage,
  Int32 dwMilliseconds );
Int16 ntxReceiveRtDataBytes (
  Int32 hMailbox,
  Byte[]pMessage,
  Int32 dwMilliseconds,
  Int32 dMax );

Parameters

hMailbox
RT data mailbox to await the data from.
pMessage
Variable or array to which the data will be copied.
dwMilliseconds
The number of milliseconds the calling thread waits:
NTX_NO_WAIT The thread does not wait.
NTX_INFINITE The thread waits for its request to be fully satisfied.
Any positive integer Calling thread goes to sleep for this many milliseconds, after which it awakes.

Note: The kernel converts milliseconds to high-level ticks.

dMax
Specifies the maximum number of bytes that can be received into the pMessage array

Return Values

The number of bytes received in this operation.

Status

E_TIME
Either the calling thread was not willing to wait and there was no message available, or the thread waited in the thread queue and its designated waiting period elapsed before the message arrived.
E_EXIST
hMailbox is not a handle for an existing object.
E_TYPE
Either hMailbox is not a handle for a mailbox or the mailbox is not a data mailbox.
E_NTX_INTERNAL_ERROR
The DLL could not contact the RT kernel to complete the request.

Requirements

Versions Reference
INtime 3.0 INtimeDotNet

See Also

INtimeDotNet system calls, Mailbox system calls, ntxImportRtHandle, Handle conversion, high-level ticks