Reducing RUI_BID Usage
The verb RUI_BID waits until a data unit is available at the server and then completes. The completion of RUI_BID notifies your program that data is ready, on a particular flow, and has a particular length. Your program can then allocate a buffer and issue an RUI_READ verb for the data.
- A message to initiate the RUI_BID
- A message to notify the workstation the bid is complete
- A message to initiate the RUI_READ
- A message returning data to the workstation
However, RUI_READ can do the same job in one step. If you simply initiate the RUI_READ verb and wait for it to complete, two LAN messages are eliminated.
The only benefit of bid logic is that you find out the size of a message before you receive it. This allows you to defer allocating a data buffer until you know how large a buffer you need. When you use only input verbs, you must know the maximum buffer size in advance, rather than allocating a buffer after the bid completes.