Skip to main content


event_io_write_string — Initiate a write of the contents of a string to an event


#include "event.h"

| int **event_io_write_string** ( | e, |   | |   | str, |   | |   | state); |   |

Event * <var class="pdparam">e</var>; string * <var class="pdparam">str</var>; event_io_state * <var class="pdparam">state</var>;


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 EVENT_IO_ERROR.

If the write completes immediately, return EVENT_IO_DONE.

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”

Return Value

This function returns one of the following values:






Only call this function from the Scheduler thread.

See Also

Was this page helpful?