Sack Library Documentation
ContentsIndexReferenceHome
PreviousUpNext
sack::network::tcp::doReadExx Function
C++
IMPORT_METHOD size_t doReadExx(PCLIENT lpClient, POINTER lpBuffer, size_t nBytes, LOGICAL bIsStream, LOGICAL bWait);
Parameters 
Description 
PCLIENT lpClient 
network client to read from 
POINTER lpBuffer 
buffer to read into 
size_t nBytes 
size of the buffer to read or maximum amount of the read desired. 
LOGICAL bIsStream 
if TRUE, any opportunity to return a packet is used to pass data to the user's read callback. If FALSE, will read to the complete size nBytes specified. 
LOGICAL bWait 
if TRUE, will block in the read until there is data, or the buffer is filled completely depending on the value of bIsStream. If FALSE, returns immediately, the read completion will be notified later by callback. 

size of the packet read if bWait is TRUE

else TRUE for sent, FALSE if the packet could not be sent. 

This buffer needs to continue existing until the socket is closed, or the read callback returns.

Used in a normal read callback...

void CPROC ReadComplete( PCLIENT pc, POINTER buffer, int size )
{
    if( buffer == NULL )
        buffer = malloc( 4096 );
    else
    {
       // size will be non 0, process buffer
    }
    ReadTCP( pc, buffer, 4096 );
}
   
   
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.
Copyright (c) 2000+. All rights reserved.
What do you think about this topic? Send feedback!