/websocket.h

http://github.com/nicolasff/webdis · C Header · 30 lines · 22 code · 8 blank · 0 comment · 0 complexity · e1f66ad7a10d7f667f017b454783c0a3 MD5 · raw file

  1. #ifndef WEBSOCKET_H
  2. #define WEBSOCKET_H
  3. #include <stdlib.h>
  4. #include <stdint.h>
  5. struct http_client;
  6. struct cmd;
  7. enum ws_state {
  8. WS_ERROR,
  9. WS_READING,
  10. WS_MSG_COMPLETE};
  11. struct ws_msg {
  12. char *payload;
  13. size_t payload_sz;
  14. size_t total_sz;
  15. };
  16. int
  17. ws_handshake_reply(struct http_client *c);
  18. enum ws_state
  19. ws_add_data(struct http_client *c);
  20. int
  21. ws_reply(struct cmd *cmd, const char *p, size_t sz);
  22. #endif