diff options
Diffstat (limited to 'src/websock.h')
-rw-r--r-- | src/websock.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/websock.h b/src/websock.h index 7785a0c0..f06bc23d 100644 --- a/src/websock.h +++ b/src/websock.h @@ -40,10 +40,9 @@ struct iovec; struct websock_itf { ssize_t (*writev) (void *, const struct iovec *, int); ssize_t (*readv) (void *, const struct iovec *, int); - void (*disconnect) (void *); - void (*on_ping) (void *); /* if not NULL, responsible of pong */ - void (*on_pong) (void *); + void (*on_ping) (void *, size_t size); /* if not NULL, responsible of pong */ + void (*on_pong) (void *, size_t size); void (*on_close) (void *, uint16_t code, size_t size); void (*on_text) (void *, int last, size_t size); void (*on_binary) (void *, int last, size_t size); @@ -53,16 +52,16 @@ struct websock_itf { struct websock; -void websock_close(struct websock *ws); -void websock_close_code(struct websock *ws, uint16_t code); +int websock_close(struct websock *ws); +int websock_close_code(struct websock *ws, uint16_t code, const void *data, size_t length); -void websock_ping(struct websock *ws); -void websock_pong(struct websock *ws); -void websock_text(struct websock *ws, const char *text, size_t length); -void websock_binary(struct websock *ws, const void *data, size_t length); +int websock_ping(struct websock *ws, const void *data, size_t length); +int websock_pong(struct websock *ws, const void *data, size_t length); +int websock_text(struct websock *ws, int last, const char *text, size_t length); +int websock_binary(struct websock *ws, int last, const void *data, size_t length); ssize_t websock_read(struct websock *ws, void *buffer, size_t size); -void websock_drop(struct websock *ws); +int websock_drop(struct websock *ws); int websock_dispatch(struct websock *ws); |