ua_job.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef UA_JOB_H_
  2. #define UA_JOB_H_
  3. #include "ua_connection.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. struct UA_Server;
  8. typedef struct UA_Server UA_Server;
  9. typedef void (*UA_ServerCallback)(UA_Server *server, void *data);
  10. typedef enum {
  11. UA_JOBTYPE_NOTHING,
  12. UA_JOBTYPE_DETACHCONNECTION, /* Detach the connection from the secure channel (but don't delete it) */
  13. UA_JOBTYPE_BINARYMESSAGE_NETWORKLAYER, /* The binary message is memory managed by the networklayer */
  14. UA_JOBTYPE_BINARYMESSAGE_ALLOCATED, /* The binary message was relocated away from the networklayer */
  15. UA_JOBTYPE_METHODCALL, /* Call the method as soon as possible */
  16. UA_JOBTYPE_METHODCALL_DELAYED, /* Call the method as soon as all previous jobs have finished */
  17. } UA_JobType;
  18. /* Jobs describe work that is executed once or repeatedly in the server */
  19. typedef struct {
  20. UA_JobType type;
  21. union {
  22. UA_Connection *closeConnection;
  23. struct {
  24. UA_Connection *connection;
  25. UA_ByteString message;
  26. } binaryMessage;
  27. struct {
  28. void *data;
  29. UA_ServerCallback method;
  30. } methodCall;
  31. } job;
  32. } UA_Job;
  33. #ifdef __cplusplus
  34. } // extern "C"
  35. #endif
  36. #endif /* UA_JOB_H_ */