readUntilAsynch

readUntilAsynch(delimiter: Binary;
                maxLength: Integer;
                receiver:  Object;
                msg:       String) abstract;

The readUntilAsynch method of the Connection class reads binary data from the connection and returns immediately. Use this method if you use delimiters as an end-of-message mechanism as part of your communications protocol so that you do not have to read one character at a time and scan or handle your own data buffering.

When the delimiter specified in the delimiter parameter has been read, the object specified in the receiver parameter is sent the message specified in the msg parameter.

You can use the maxLength parameter to specify a maximum read size if the specified delimiter cannot be found. (A value of zero indicates that there is no maximum read size.)

A String value typecast to a Binary value and specified as a delimiter in a Unicode JADE system contains Unicode characters in the Binary value.

When executing the readUntilAsynch notification method, ensure that all received data has been handled, copied, or stored before issuing another readUntilAsynch method. If the readUntilAsynch notification method executes another readUntilAsynch method, it overwrites the data that was previously received, if data is readily available on the connection.

Only one synchronous or asynchronous read operation can be performed at one time on a connection.

The readUntilAsynch method can be called only when the value of the Connection class state property is Connected (2). See also the Connection class timeout property.

When the delimiter specified in the delimiter parameter has been read, the user-written callback method specified in the msg parameter is called.

The callback method must match the signature required by the calling readUntilAsynch method, as follows.

readUntilNotify(connection: Connection;
                bin:        Binary);