event_io_write_string — Initiate a write of the contents of a string to an event
int **event_io_write_string** ( | e, | |
| | str, | |
| | state
); | |
Initiate a write of the contents of a string to an event.
Writes a string buffer to an event. If the string is disk-backed, this routine will advance to the next chunk when the in-memory portion is exhausted, until the entire string has been sent.
If the write cannot be satisfied immediately, this function stores state information into the state parameter and returns
EVENT_IO_PENDING. state->needmask will be set to the mask required for scheduling purposes. The caller should call event_io_write_string when the scheduler indicates that the underlying event is signalled with state->needmask.
If the write failed, this function returns
If the write completes immediately, return
state must not be NULL, and must either be zero'ed out or be a value state structure previously used by other event_io_XXX routines.
It is advantageous to reuse state structures, as they try to avoid allocating memory if they already have an appropriately sized buffer.
When a state structure is no longer required, you should free resources by calling event_io_state_clean.
The ec_string that you wish to write.
For a description of this data type see “event_io_state”
This function returns one of the following values:
Only call this function from the