From INtime 6.0 the INtime Service and Port objects have been deprecated.
New projects should not be started using these features, and existing projects will not work with XM mode
The CIPort class encapsulates the RT port object; it allows sending messages to and receiving messages from a port service. The CIPort class is typically used as it is.
Constructor
Destructor
Create
Send
SendRSVP
Receive
ReceiveReply
CancelTransaction
The following member variable is only available to the members of the class and its derived classes:
RTHANDLE m_hHeap;
The constructor has no arguments. It creates an unattached object.
If the object is attached, the destructor detaches it; then it destroys the object.
If the object is already attached, it is first detached. Then this call creates an RT port object and attaches it to the object.
DWORD CIPort::Create( char * pszName, char * pszService, WORD wPort, WORD wTrans, DWORD dwHeapSize, BOOLEAN bPrioQ );
pszName
pszService
wPort
wTrans
dwHeapSize
bPrioQ
E_OK
E_MEM
E_LIMIT
E_SLOT
E_CONTEXT
E_PARAM
With this call a message is sent.
WORD CIPort::Send( LPBYTE pControl, WORD wCtlLen, PVOID pData, DWORD dwDataLen, LPGENADDR pAddr, WORD wFlags );
pControl
wCtlLen
pData
dwDataLen
pAddr
wFlags
CONTIGUOUS_BUFFER |
Specifies that pData references a contiguous buffer. |
DATA_CHAIN_BUFFER |
Specifies that pData references a data chain block. |
DATA_LIST_BUFFER |
Specifies that pData references the first element in a data list (buffer type fields are mutually-exclusive). |
SYNC_MODE |
Specifies that the message should be transmitted synchronously. |
ASYNC_MODE |
Specifies that the message should be transmitted asynchronously (the mode fields are mutually exclusive). |
If wFlags is omitted, CONTIGUOUS_BUFFER and SYNC_MODE is assumed. The result is a transaction ID (if there is a data message and ASYNC_MODE was specified) or zero for a successful send, or BAD_TRANSACTION_ID for a failure. In the latter case call GetLastError to get the exception code:
E_OK
E_EXIST
With this call a message is sent, with an implied request for a reply.
WORD CIPort::SendRSVP( LPBYTE pControl, WORD wCtlLen, PVOID pData, DWORD dwDataLen, LPGENADDR pAddr, WORD wFlags, PVOID pReply, DWORD dwReplyLen ); WORD CIPort::SendRSVP( LPBYTE pControl, WORD wCtlLen, PVOID pData, DWORD dwDataLen, PVOID pReply, DWORD dwReplyLen ); WORD CIPort::SendRSVP( LPBYTE pControl, WORD wCtlLen, PVOID pReply, DWORD dwReplyLen );
pControl
wCtlLen
pData
dwDataLen
pAddr
wFlags
CONTIGUOUS_BUFFER |
Specifies that pData references a contiguous buffer. |
DATA_CHAIN_BUFFER |
Specifies that pData references a data chain block. |
DATA_LIST_BUFFER |
Specifies that pData references the first element in a data list (buffer type fields are mutually-exclusive). |
SYNC_MODE |
Specifies that the message should be transmitted synchronously. |
ASYNC_MODE |
Specifies that the message should be transmitted asynchronously (the mode fields are mutually exclusive). |
USE_RECEIVE_REPLY |
Use ReceiveReply to receive the response message. |
USE_RECEIVE |
Use Receive to receive the response message (the receive fields are mutually exclusive). |
If wFlags is omitted, CONTIGUOUS_BUFFER, SYNC_MODE and USE_RECEIVE_REPLY is assumed. pReply points to a buffer to receive the reply; dwReplyLen indicates the size of that buffer in bytes. Note that these last two parameters cannot be omitted. The result is a a transaction ID for a successful send, or BAD_TRANSACTION_ID for a failure. In the latter case call GetLastError to get the exception code:
E_OK
E_EXIST
This call puts the thread in a sleep state until a message has been received, or until a timeout occurs.
PVOID CIPort::Receive( LPRECEIVEINFO pReceive, DWORD dwTimeout );
pReceive
dwTimeout
E_OK
E_TIME
E_EXIST
This call puts the thread in a sleep state until a reply message has been received, or until a timeout occurs.
PVOID CIPort::ReceiveReply( LPREPLYINFO pReceive, WORD wTransID, DWORD dwTimeout );
pReceive
wTransID
dwTimeout
E_OK
E_TIME
E_EXIST
This call cancels a pending transaction.
DWORD CIPort::CancelTransaction( WORD wTransID );
wTransID
E_OK
E_EXIST