Retrieving data from a client

A writetext stream triggers a SRV_BULK event. Because text and image data retrieved from a client are considered bulk data, an Open Server application processes incoming text and image data from inside its bulk handler. For more information on types of bulk data see the Open Client and Open Server Common Libraries Reference Manual.

An application processes incoming text or image data in two steps:

  1. The srv_text_info routine retrieves a description of the text or image data and places the information in a CS_IODESC structure. This call returns a variety of information, the most important of which is the total length of the data. Based on the length, the application can decide whether to retrieve the data all at once or in sections, as well as how large a buffer to allocate to store the data. srv_text_info is called with the cmd argument set to CS_GET.

  2. The srv_get_text routine actually brings the data over from the client in the specified section size and stores it in the specified buffer.

Note that a call to srv_text_info must always precede a call to srv_get_text. The srv_get_text routine must be called until all text has been read from the client.