gensio_acc_accept_s - Man Page
Synchronous I/O operations on a gensio accepter
Synopsis
#include <gensio/gensio.h>
- int gensio_acc_set_sync(struct gensio_accepter *acc);
- int gensio_acc_accept_s(struct gensio_accepter *acc,
struct gensio_time *timeout,
struct gensio **new_io);- int gensio_acc_accept_s_intr(struct gensio_accepter *acc,
struct gensio_time *timeout,
struct gensio **new_io);
Description
Normal gensio accepter operation is asynchronous callback based. This serves most programs fairly well, especially if they need to handle multiple accepts on the same or different accepters.
But occasionally you need to do something synchronous with the program execution, especially if you have a simple program that just accepts one connection and then does something.
gensio_acc set_sync sets up the gensio accepter for synchronous accepts. If you do this, the event callback that is currently registered will no longer receive new connection events. It *will* receive other callbacks. You must call this before starting up the gensio accepter, and once you call it the gensio accepter is in sync mode until you shut it down.
gensio_accept_s Waits for an incoming connection on the gensio accepter. This function waits for the amount of time in timeout. timeout is updated to the amount of time left to wait. If timeout is NULL, wait forever. If no error is returned, the new incoming connection is returned in new_io.
gensio_accept_s_intr is like gensio_accept_s, but it return immediately if an signal interrupt occurs. On systems without signals, this is the same as gensio_accept_s.
Return Values
Zero is returned on success, or a gensio error on failure.
See Also
Referenced By
The man page gensio_acc_set_sync(3) is an alias of gensio_acc_accept_s(3).