Back to the WFC main page

CDataSocket : CDataFile

$Revision: 15 $

Description

This class allows you handle the input and output of CDataChunk objects through a TCP/IP socket easily.

Data Members

None.

Constructors

CDataSocket()
CDataSocket( CSimpleSocket * socket_p )
Constructs the object.

Methods

void Attach( CSimpleSocket * socket_p )
Tells CDataSocket which socket to use.
UINT Read( void * buffer, UINT number_of_bytes_to_read )
Reads data from the socket.
long Seek( long offset, UINT from )
Intercepts this call. It doesn't make a whole lot of sense to Seek() around a socket.
void Write( const void * buffer, UINT number_of_bytes_to_read )
Reads data from the socket.

Example

#include <wfc.h>

void read_next_chunk( CDataSocket& socket, CDataChunk& data )
{
   WFCTRACEINIT( TEXT( "read_next_chunk()" ) );

   socket.GetData( data );

   _tprintf( TEXT( "Read %lu bytes\n" ), data.Data.GetSize() );
}

Copyright, 2000, Samuel R. Blackburn
$Workfile: CDataSocket.cpp $
$Modtime: 1/17/00 8:59a $