connectionManager.hpp 699 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef myCONNMANAGE_H
  2. #define myCONNMANAGE_H
  3. #include <iostream>
  4. #include <stdio.h>
  5. #include <sys/types.h>
  6. #include <pthread.h>
  7. #include "udp.hpp"
  8. /*
  9. worker thread:
  10. takes jobs
  11. assigns free fpga
  12. queue response
  13. cb on overwrite + delete old resp
  14. fills send buffer
  15. send thread:
  16. cycle fd
  17. send 1 packet if available
  18. recv thread:
  19. select(readFD)
  20. recv data into response
  21. cb on success + delete response
  22. response thread:
  23. search old responses
  24. cb on timeout + delete response
  25. */
  26. extern commFPGA fpgas[];
  27. extern const uint fpgaCount;
  28. int sendJob(jobData *job, uint recvPayloadLength);
  29. void connection_init();
  30. void connection_close();
  31. #endif