mtcp_settimer

NAME

mtcp_settimer − register user’s timer-based callback handler

SYNOPSIS

#include <mos_api.h>

int mtcp_settimer(mctx_t mctx, int id, struct timeval *timeout, callback_t cb);

DESCRIPTION

mtcp_settimer() can be used to register callback handler function, cb , that is invoked after a time interval of timeout microseconds. Note that this callback is a one time registration and cb (see mtcp_register_callback() for definition) is called only once when timeout period expires. The id argument is a unique identifier that is passed to cb as one of the function arguments.

mtcp_settimer() call takes an additional argument named mctx that represents the per-core mTCP context in an application (see mtcp_create_context() for details).

RETURN VALUE

On success 0 is returned; -1 on failure.

AUTHORS

mOS development team <mtcp-user@list.ndsl.kaist.edu>

EXAMPLES

http://mos.kaist.edu/guide/programmer/05_api_example.html#registering-for-timer-events

SEE ALSO

mtcp_register_callback(), mtcp_socket(),

COLOPHON

This page is part of mOS release 0.3 docs section. A description of the project, and information about reporting bugs, can be found at http://mos.kaist.edu/.