Receives data through the connection.
The data read.
|BytesToRead||The number of bytes to read.|
|BytesActuallyRead||The number of bytes actually read.|
The RECEIVE service reads a string of data from the remote server. While the call is simple, using it correctly is not. You must always keep in mind that the data you send is treated as an array of bytes. Therefore, if the server on the other sends a 32-bit integer value, you must read four bytes (or chars) and convert it from a 32-bit integer into an OI number. What the server sends to you all depends on its TCP/IP protocol. You'll have to refer to the server's documentation for that information.
Note also that this method causes OI to wait for as long as possible for data to come in. If it takes an hour, OI will wait for an hour.
Pass the number of bytes you are expecting via the BytesToRead parameter, and pass an empty variable to the BytesActuallyRead parameter. BytesActuallyRead will be set to 0 or more bytes actually read. If it is 0, this means the connection to the server was lost.