ua_job.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  4. #ifndef UA_JOB_H_
  5. #define UA_JOB_H_
  6. #include "ua_connection.h"
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. struct UA_Server;
  11. typedef struct UA_Server UA_Server;
  12. typedef void (*UA_ServerCallback)(UA_Server *server, void *data);
  13. typedef enum {
  14. UA_JOBTYPE_NOTHING,
  15. UA_JOBTYPE_DETACHCONNECTION, /* Detach the connection from the secure channel (but don't delete it) */
  16. UA_JOBTYPE_BINARYMESSAGE_NETWORKLAYER, /* The binary message is memory managed by the networklayer */
  17. UA_JOBTYPE_BINARYMESSAGE_ALLOCATED, /* The binary message was relocated away from the networklayer */
  18. UA_JOBTYPE_METHODCALL, /* Call the method as soon as possible */
  19. UA_JOBTYPE_METHODCALL_DELAYED, /* Call the method as soon as all previous jobs have finished */
  20. } UA_JobType;
  21. /* Jobs describe work that is executed once or repeatedly in the server */
  22. typedef struct {
  23. UA_JobType type;
  24. union {
  25. UA_Connection *closeConnection;
  26. struct {
  27. UA_Connection *connection;
  28. UA_ByteString message;
  29. } binaryMessage;
  30. struct {
  31. void *data;
  32. UA_ServerCallback method;
  33. } methodCall;
  34. } job;
  35. } UA_Job;
  36. #ifdef __cplusplus
  37. } // extern "C"
  38. #endif
  39. #endif /* UA_JOB_H_ */