ua_job.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright (C) 2014 the contributors as stated in the AUTHORS file
  3. *
  4. * This file is part of open62541. open62541 is free software: you can
  5. * redistribute it and/or modify it under the terms of the GNU Lesser General
  6. * Public License, version 3 (as published by the Free Software Foundation) with
  7. * a static linking exception as stated in the LICENSE file provided with
  8. * open62541.
  9. *
  10. * open62541 is distributed in the hope that it will be useful, but WITHOUT ANY
  11. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  13. * details.
  14. */
  15. #ifndef UA_JOB_H_
  16. #define UA_JOB_H_
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. struct UA_Connection;
  21. typedef struct UA_Connection UA_Connection;
  22. struct UA_Server;
  23. typedef struct UA_Server UA_Server;
  24. typedef void (*UA_ServerCallback)(UA_Server *server, void *data);
  25. /** Jobs describe work that is executed once or repeatedly in the server */
  26. typedef struct {
  27. enum {
  28. UA_JOBTYPE_NOTHING, ///< Guess what?
  29. UA_JOBTYPE_DETACHCONNECTION, ///< Detach the connection from the secure channel (but don't delete it)
  30. UA_JOBTYPE_BINARYMESSAGE_NETWORKLAYER, ///< The binary message is memory managed by the networklayer
  31. UA_JOBTYPE_BINARYMESSAGE_ALLOCATED, ///< The binary message was relocated away from the networklayer
  32. UA_JOBTYPE_METHODCALL, ///< Call the method as soon as possible
  33. UA_JOBTYPE_METHODCALL_DELAYED, ///< Call the method as soon as all previous jobs have finished
  34. } type;
  35. union {
  36. UA_Connection *closeConnection;
  37. struct {
  38. UA_Connection *connection;
  39. UA_ByteString message;
  40. } binaryMessage;
  41. struct {
  42. void *data;
  43. UA_ServerCallback method;
  44. } methodCall;
  45. } job;
  46. } UA_Job;
  47. #ifdef __cplusplus
  48. } // extern "C"
  49. #endif
  50. #endif /* UA_JOB_H_ */