diff options
author | José Bollo <jose.bollo@iot.bzh> | 2016-07-27 15:51:01 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2016-07-27 17:40:58 +0200 |
commit | 1ea6bd0f466a10d29f12801aa35fb6d2b30443a1 (patch) | |
tree | 308bbc689182de8cfd9e42f76dea57455d3a5434 /src/afb-ws-client.h | |
parent | 1d0f869ce3379089b4f4c5285e3d30e971e5b93d (diff) |
Expose use of the event loop
The use of the event loop where previously hidden
in internal deep places of the websocket modules.
This commits enforce the client of the library to
explicitely tell what event loop must be used.
This has 3 effects:
- you know that the systemd event loop is used
- you tell the event loop to use (no confusion)
- you don't depend on afb-common.c
Change-Id: Id13d8a96f981183c299cde414d9bb0cd77fe3daa
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-ws-client.h')
-rw-r--r-- | src/afb-ws-client.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/afb-ws-client.h b/src/afb-ws-client.h index cac4c782..7dd825fe 100644 --- a/src/afb-ws-client.h +++ b/src/afb-ws-client.h @@ -19,15 +19,13 @@ struct afb_wsj1; struct afb_wsj1_itf; +struct sd_event; /* * Makes the WebSocket handshake at the 'uri' and if successful * instanciate a wsj1 websocket for this connection using 'itf' and 'closure'. * (see afb_wsj1_create). + * The systemd event loop 'eloop' is used to handle the websocket. * Returns NULL in case of failure with errno set appriately. */ -extern struct afb_wsj1 *afb_ws_client_connect_wsj1(const char *uri, struct afb_wsj1_itf *itf, void *closure); - -struct sd_event; -extern struct sd_event *afb_ws_client_get_event_loop(); - +extern struct afb_wsj1 *afb_ws_client_connect_wsj1(struct sd_event *eloop, const char *uri, struct afb_wsj1_itf *itf, void *closure); |