AsyncSocket: how to define read length and get callback only when read length is reached
问题 Is it possible to do the following with AsyncSocket: while ("response packet" is not read) do { Read at least first 5 bytes from read stream, and extract "response packet" length size from that. Read further until reached reading amount of bytes defined in "response packet" header. If reached the end of read stream but some bytes are lacking then wait for another read stream and finish reading the "response packet" then. Copy read bytes into buffer and mark that read data as "response packet"