networklayer_tcp.h 949 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  3. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information.
  4. */
  5. #ifndef NETWORKLAYERTCP_H_
  6. #define NETWORKLAYERTCP_H_
  7. #ifdef WIN32
  8. #include "winsock2.h"
  9. #else
  10. #include <sys/mman.h>
  11. #include <sys/wait.h>
  12. #include <unistd.h>
  13. #include <sys/time.h>
  14. #endif
  15. #include "ua_server.h"
  16. struct NetworklayerTCP;
  17. typedef struct NetworklayerTCP NetworklayerTCP;
  18. #define BINARYCONNECTION_PROTOCOL_VERSION 0
  19. #define BINARYCONNECTION_MAX_CHUNK_COUNT 1
  20. #define BINARYCONNECTION_MAX_MESSAGE_SIZE 8192
  21. UA_Int32 NetworklayerTCP_new(NetworklayerTCP **newlayer, UA_ConnectionConfig localConf,
  22. UA_UInt32 port);
  23. void NetworklayerTCP_delete(NetworklayerTCP *layer);
  24. UA_Int32 NetworkLayerTCP_run(NetworklayerTCP *layer, UA_Server *server, struct timeval tv,
  25. void(*worker)(UA_Server*), UA_Boolean *running);
  26. #endif /* NETWORKLAYERTCP_H_ */