skynet_server.h 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. #ifndef SKYNET_SERVER_H
  2. #define SKYNET_SERVER_H
  3. #include <stdint.h>
  4. #include <stdlib.h>
  5. struct skynet_context;
  6. struct skynet_message;
  7. struct skynet_monitor;
  8. struct skynet_context * skynet_context_new(const char * name, const char * parm);
  9. void skynet_context_grab(struct skynet_context *);
  10. void skynet_context_reserve(struct skynet_context *ctx);
  11. struct skynet_context * skynet_context_release(struct skynet_context *);
  12. uint32_t skynet_context_handle(struct skynet_context *);
  13. int skynet_context_push(uint32_t handle, struct skynet_message *message);
  14. void skynet_context_send(struct skynet_context * context, void * msg, size_t sz, uint32_t source, int type, int session);
  15. int skynet_context_newsession(struct skynet_context *);
  16. struct message_queue * skynet_context_message_dispatch(struct skynet_monitor *, struct message_queue *, int weight); // return next queue
  17. int skynet_context_total();
  18. void skynet_context_dispatchall(struct skynet_context * context); // for skynet_error output before exit
  19. void skynet_context_endless(uint32_t handle); // for monitor
  20. void skynet_globalinit(void);
  21. void skynet_globalexit(void);
  22. void skynet_initthread(int m);
  23. void skynet_profile_enable(int enable);
  24. #endif