4 #include <ccan/tevent/tevent.h>
7 * oserver_setup - set up an oserver
8 * @ev: tevent context to use.
9 * @port: port to use (usually OSERVER_PORT)
11 * Opens a socket and binds it to @port, then sets it up to listen
12 * for connections. talloc_free() the pointer returned to shut it down
13 * (its parent is the tevent_context).
16 * struct oserver *oserver;
17 * struct tevent_context *ev;
19 * ev = tevent_context_init(NULL);
20 * oserver = oserver_setup(ev, OSERVER_PORT);
22 * err(1, "Failed to set up server");
24 * while (tevent_loop_wait(ev) == 0);
25 * err(1, "Event loop failed");
27 struct oserver *oserver_setup(struct tevent_context *ev, unsigned short port);
29 #define OSERVER_PORT 2828
30 #endif /* CCAN_OSERVER_H */