readBinaryAsynch

readBinaryAsynch(length:   Integer;
                 receiver: Object;
                 msg:      String);

The readBinaryAsynch method of the NamedPipe class initiates a read of binary data from the connection and returns immediately.

If the value of the Connection superclass fillReadBuffer property is true, when the bytes of data specified in the length parameter have been read, the callback method name is called for the object specified in the receiver parameter.

If the value of the fillReadBuffer property is false, when the entire message has been read, the callback method name specified in the msg parameter is called for the object specified in the receiver parameter. The length parameter is used as the block size for reading and assembling the entire message. If the length parameter is set to zero (0), 4,000 bytes are used as the block size.

An exception is raised if this method is invoked from a server method when the server node is not running under a Windows operating system that supports services.

One synchronous or asynchronous read operation only can be performed at a time for any one connection.

The readBinaryAsynch method can be called only when the value of the Connection superclass state property is Connected (2).

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

readBinaryCallback(pipe:   NamedPipe;
                   buffer: Binary);

If the read fails, a connection exception is raised, specifying a Windows error number and description.

If the other end of the connection has been closed, this end of the connection is also closed. If this occurs, the value of the Connection superclass state property is Disconnected (0) and the Microsoft Windows exception that is raised is usually 109 (broken pipe).