PDA

View Full Version : ISocket_Read giving only 1st 2 bytes.


compuser1978
03-22-2002, 03:30 PM
I am reading a string from Java server socket. However I can see only the first 2 bytes of the string that is sent.
I am using ISocket_read(pme, szBuf, 8); cos the string I am receaving is 8 bytes long.

kamal
03-22-2002, 08:05 PM
Refer to Socket usage example on how to read data using the ISocket interface. You should check for WOULDBLOCK return value from the ISOCKET_Read() call and register a callback by using the ISOCKET_Readable() API so that whenever remaining data is available, this callback function will be invoked by the AEE layer.

Also refer to following FAQ for more information http://www.qualcomm.com/brew/developer/support/faq/techfaq7.html

-Kamal
BREW Support

compuser1978
03-23-2002, 08:44 AM
I am using the ISocket_wouldblock to make sure I get all the data. The first time the data is available, I get only the 1st 2 bytes(of the 8 bytes) that I am supposed to receive from the Java server.
Do you say, it is possible that I receive just 2 bytes per read??
It will be a great help if you can explain.

Jason wen
03-25-2002, 08:15 PM
Hi:

I guess the server send a 8 bytes structure and the structure include a string array member.

compuser1978
03-26-2002, 09:00 AM
Its solved...I had not used the ISocket_wouldblock at the right place.

Thanks again.