mio_raw.cc File Reference

MIO read/write functions to read/write on unencrypted network sockets. More...

#include <jabberd.h>

Functions

void _mio_raw_parser (mio m, const void *buf, size_t bufsz)
ssize_t _mio_raw_read (mio m, void *buf, size_t count)
ssize_t _mio_raw_write (mio m, void *buf, size_t count)

Detailed Description

MIO read/write functions to read/write on unencrypted network sockets.


Function Documentation

void _mio_raw_parser ( mio  m,
const void *  buf,
size_t  bufsz 
)

receiving bytes on a network socket

the _mio_raw_parser implements a mio parser, that does not parse the received data at all, but just passes the received data as bytes to the application callback function, that registered for this mio object

Parameters:
m the mio object where the data has been read
buf the data that has been read
bufsz the number of bytes, that have been read on the socket

References mio_st::cb, mio_st::cb_arg, and MIO_BUFFER.

ssize_t _mio_raw_read ( mio  m,
void *  buf,
size_t  count 
)

read data from a network socket, that does not use TLS encryption

m->flags.recall_read_when_writeable is cleared, m->flags.recall_read_when_readable is updated by this function

Parameters:
m the mio representing this socket
buf the buffer where to read data to
count size of the buffer, how many data should be read at most
Returns:
0 < ret < count: ret bytes read and no more bytes to read; ret = count: ret bytes read, possibly more bytes to read; ret = 0: currently nothing to read; ret < 0: non-recoverable error or connection closed

References mio_st::fd.

ssize_t _mio_raw_write ( mio  m,
void *  buf,
size_t  count 
)

write data to a network socket, that does not use TLS encryption

m->flags.recall_write_when_readable is clared, m->flags.recall_write_when_writeable is updated by this function

Parameters:
m the mio representing this socket
buf the data that should be written
count how many bytes should be written (at most)
Returns:
ret > 0: ret bytes written; ret == 0: no bytes could be written; ret < 0: non-recoverable error or connection closed

References mio_st::fd.

Generated on Fri Sep 3 06:00:07 2010 for jabberd14 by  doxygen 1.6.3