Client.h 487 B

12345678910111213141516171819202122232425262728
  1. #ifndef CLIENT_H
  2. #define CLIENT_H
  3. #include <pthread.h>
  4. #include "Stream.h"
  5. typedef struct Client
  6. {
  7. short port;
  8. int socket;
  9. pthread_t thread;
  10. ClientStreamFunction handler;
  11. } Client;
  12. void clientInitDefaults(Client* c);
  13. int clientInit(Client* c, char* ip, short port);
  14. void clientRemove(Client* c);
  15. int clientReceive(Client* c, Stream* in);
  16. int clientSendData(Client* c, Stream* out);
  17. void clientRegisterHandler(Client* c, ClientStreamFunction f);
  18. #endif