Re: [xSocket-develop] receiving data from server
Status: Inactive
Brought to you by:
grro
From: quan n. h. <hu...@gm...> - 2010-02-25 03:36:12
|
i check doc again & found this code private int remaining = 0; .. int available = nbc.available(); int lengthToRead = remaining; if (available > remaining) { lengthToRead = available; } byte[] message = nbc.readBytesByLength(lengthToRead); is it the right way? -Quan On Thu, Feb 25, 2010 at 10:10 AM, quan nguyen huu <hu...@gm...> wrote: > hi, > > in client, i use readBytesBylength() to receive data from server: > nbc.readBytesByLength(200); > > but the problem is the message server send to client have different lengths. > example: first, server send 20 bytes message, after server send 7 > bytes message to client. > the client always seems to wait for receive full 200 bytes message to > process next step :| > > how to get instant message sent from server. > > thanks > -Quan > |