networklayer_tcp.h 975 B

123456789101112131415161718192021222324252627282930313233
  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_StatusCode NetworklayerTCP_new(NetworklayerTCP **newlayer, UA_ConnectionConfig localConf, UA_UInt32 port);
  22. void NetworklayerTCP_delete(NetworklayerTCP *layer);
  23. UA_StatusCode NetworkLayerTCP_run(NetworklayerTCP *layer, UA_Server *server, struct timeval tv,
  24. void(*worker)(UA_Server*), UA_Boolean *running);
  25. #endif /* NETWORKLAYERTCP_H_ */