Client.h 522 B

123456789101112131415161718192021222324252627282930
  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. int hAmount;
  11. int hIndex;
  12. ClientStreamFunction* handlers;
  13. } Client;
  14. void clientInitDefaults(Client* c);
  15. int clientInit(Client* c, char* ip, short port);
  16. void clientRemove(Client* c);
  17. int clientReceive(Client* c, Stream* in);
  18. int clientSendData(Client* c, Stream* out);
  19. void clientRegisterHandler(Client* c, ClientStreamFunction f);
  20. #endif