tcp.h 402 B

12345678910111213141516171819202122
  1. #ifndef __TCP_H
  2. #define __TCP_H
  3. #include <stdint.h>
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. int tcp_listen(int port, int nb_connection);
  8. int tcp_accept(int s);
  9. void tcp_close(int s);
  10. int tcp_send(int s, const uint8_t *buf, int length);
  11. int tcp_receive(int s, uint8_t *buf, int bufsz, int timeout);
  12. int tcp_flush(int s);
  13. int tcp_connect(const char *ip, int port);
  14. #ifdef __cplusplus
  15. }
  16. #endif
  17. #endif