31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

secure socket streambuf sb(leda socket& s, const CryptByteString& passphrase,<br />

uint32 out buf sz = DefaultBufferSize,<br />

uint32 in buf sz = DefaultBufferSize,<br />

bool enable compression = false,<br />

bool send acknowledge = false);<br />

as above, but the same passphrase is used for generating both the<br />

authentication and the encryption key. However, it is still guaranteed<br />

that two different keys are used.<br />

3. Operations<br />

<strong>The</strong> class secure socket streambuf inherits most of its operations from the class streambuf<br />

that belongs to the C++ standard library. Usually there is no need to call these operations<br />

explicitly. (You can find documentation for streambuf at http://www.cplusplus.com)<br />

bool sb.failed( ) returns whether a failure has occured.<br />

string sb.get error( ) returns an error message (if available).<br />

void sb.sputEOF( ) signals the end of the transmission to the receiving<br />

socket, so that it does not wait for further data. (This<br />

function is called automatically in the destructor unless<br />

it has been called explicitly by the user. If sb is not<br />

immediately destroyed after the end of the transmission<br />

then you should call sputEOF explicitly, otherwise<br />

the receiving party might incur a timeout error.)<br />

bool sb.has put EOF( ) returns whether EOF has already been sent.<br />

bool sb.has got EOF( ) returns whether EOF has already been received.<br />

leda socket& sb.get socket( )<br />

returns the socket to which sb is attached.<br />

uint32 sb.get outgoing packet size( )<br />

uint32 sb.get incoming packet size( )<br />

bool sb.uses compression( )<br />

bool sb.waits for acknowledge( )<br />

returns the (actual) outgoing packet size.<br />

returns the (actual) incoming packet size.<br />

returns whether sb compresses outgoing packets before<br />

sending.<br />

returns whether sb expects an acknowledgement for<br />

outgoing packets.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!