wac_network_onconncb_api.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef __WASABI_API_WEBSERV_ONCONNCB_H
  2. #define __WASABI_API_WEBSERV_ONCONNCB_H
  3. #include "bfc/dispatch.h"
  4. #include "bfc/platform/types.h"
  5. //#include "listen.h"
  6. class api_webserv;
  7. class api_pagegenerator;
  8. class api_httpserv;
  9. class JNL_Listen;
  10. class api_onconncb : public Dispatchable
  11. {
  12. protected:
  13. api_onconncb() {}
  14. ~api_onconncb() {}
  15. public:
  16. api_pagegenerator *onConnection( api_httpserv *serv, int port );
  17. void destroyConnection( api_pagegenerator *conn );
  18. DISPATCH_CODES
  19. {
  20. API_ONCONNCB_ONCONNECTION = 10,
  21. API_ONCONNCB_DESTROYCONNECTION = 20,
  22. };
  23. api_webserv *caller = NULL;
  24. };
  25. inline api_pagegenerator *api_onconncb::onConnection( api_httpserv *serv, int port )
  26. {
  27. return _call( API_ONCONNCB_ONCONNECTION, (api_pagegenerator *)0, serv, port );
  28. }
  29. inline void api_onconncb::destroyConnection( api_pagegenerator *connection )
  30. {
  31. _voidcall( API_ONCONNCB_DESTROYCONNECTION, connection );
  32. }
  33. #endif // !__WASABI_API_WEBSERV_ONCONNCB_H