Consultor Eletrônico



Kbase P17213: BYTES-READ returns two extra character
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/16/2008
Status: Unverified

SYMPTOM(s):

BYTES-READ returns two extra character

CAUSE:

carriage return added by some program languages on the other side of the socket

FIX:

When reading data from a socket be aware of the READ method options and the carriage return added by some program languages (on the other side of the socket), like Java when using ?println?. This might changed expected string return:

READ-AVAILABLE [1] The READ( ) method will block until at least one byte has en read on the socket. It will read up to bytes-to-read bytes

READ-EXACT-NUM [2] The READ( ) method will block until bytes-to-read bytes have been read from the socket.

The GET-BYTES-AVAILABLE Indicates the number of bytes available for reading from the socket.