Determining SAP-SPP link validity and MAX_NO_DATA |
Category: |
Micro-RTS
Applicable to: |
All Versions
Description: |
Is there a service for determining if a SPP/SAP link is valid? How does MAX_NO_DATA relate to this?
The MAX_NO_DATA is used to detect when the other side disconnects, this is required because there is not necessarily any socket activity to inform the other side upon disconnect, and thus one side could basically sit forever thinking that the other side is still connected. By detecting that the other side has disconnected, we can then allow new connections to occur. No attempt is made by the RTS to inform the application when a connection is established, or when it is broken. The application may detect this by doing a SEND and examining the return code. If there is no "other side" the send will fail.
There should usually be an application-level protocol which informs the other side when a new connection is established. That way, the SAP knows that there is a new object on the other side of the connection, and that anything that it was previously connected to has gone away. This is particularly important if the SAP/SPP are being used in an ongoing transaction (rather than a one-shot message). The point about the need for polling the SAP/SPP connection to know if it is valid, is that because applications are not informed when the connection is established initially, or subsequently broken, that prior to sending any essential message, the sender must be certain that a connection exists. The sender should also watch the return code from the SEND and be prepared to handle the SEND failure condition.
Limitations: |
None
Copyright © 1999, ObjecTime Limited. |