NSSLWrite

Syntax

#include <cafe.h>
#include <cafe/nssl/nsslclient.h>

NSSL_RVAL NSSLWrite(NSSLConnectionHandle connection,
              const void* pBuf,
              int len,
              int* pBytesWritten);

Parameters

connection A handle to a SSL connection to write to.
pBuf Buffer to write into. (The buffer size and address should be aligned to NSSL_IO_BUFFER_ALIGN)
len Number of bytes to write.
pBytesWritten A pointer to hold the count of bytes written.

Return Values

NSSL_RVAL_OK Success.
NSSL_RVAL_ZERO_RETURN The SSL connection has been closed.
NSSL_RVAL_WANT_READ/NSSL_RVAL_WANT_WRITE (Only applicable for non-blocking connections) The operation did not complete; the same NSSL I/O function should be called again later. If, by then, the underlying socket has data available for reading (if the result code is NSSL_RVAL_WANT_READ) or allows writing data (NSSL_RVAL_WANT_WRITE), then some TLS/SSL protocol progress will take place, i.e., at least part of a TLS/SSL record will be read or written. The retry may again lead to a NSSL_RVAL_WANT_READ or NSSL_RVAL_WANT_WRITE condition. There is no fixed upper limit for the number of iterations that may be necessary until progress becomes visible at the application protocol level.
NSSL_RVAL_IO_ERROR Some IO error occurred on the underlying socket.
NSSL_RVAL_NSSLLIB_ERROR A failure in the SSL library occurred.

Description

Writes to the SSL connection. The count of bytes written is written into pBytesWritten when completed.

Do Not Call From

Callbacks Do not call this function from any callback function.
Interrupt handler Do not call this function from any interrupt handler.
Exception handler Do not call this function from any exception handler.

See Also

NSSLRead

Revision History

2012/08/16 Cleanup pass.
2012/04/06 Initial version.


CONFIDENTIAL