Scroll to navigation

gensio_acc_accept_s(3) Library Functions Manual gensio_acc_accept_s(3)


gensio_acc_set_sync, gensio_acc_accept_s, gensio_acc_accept_s_intr - Synchronous I/O operations on a gensio accepter


#include <gensio/gensio.h>

struct gensio_time *timeout,
struct gensio **new_io);

struct gensio_time *timeout,
struct gensio **new_io);


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.


Zero is returned on success, or a gensio error on failure.


gensio_err(3), gensio_set_sync(3), gensio(5)

27 Jan 2020