PageRenderTime 27ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/src/server/authserver/Server/RealmAcceptor.h

http://github.com/SingularityCore/Singularity
C Header | 47 lines | 22 code | 7 blank | 18 comment | 2 complexity | 4695e2b5b4a315406c99278738ac6ca4 MD5 | raw file
Possible License(s): GPL-2.0, CC-BY-SA-3.0, BSD-3-Clause
  1. /*
  2. * Copyright (C) 2011 SingularityCore <http://www.singularitycore.org/>
  3. * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
  4. * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation; either version 2 of the License, or (at your
  9. * option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful, but WITHOUT
  12. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  14. * more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef __REALMACCEPTOR_H__
  20. #define __REALMACCEPTOR_H__
  21. #include <ace/Acceptor.h>
  22. #include <ace/SOCK_Acceptor.h>
  23. #include "RealmSocket.h"
  24. #include "AuthSocket.h"
  25. class RealmAcceptor : public ACE_Acceptor<RealmSocket, ACE_SOCK_Acceptor>
  26. {
  27. public:
  28. RealmAcceptor(void) { }
  29. virtual ~RealmAcceptor(void) { }
  30. protected:
  31. virtual int make_svc_handler(RealmSocket *&sh)
  32. {
  33. if (sh == 0)
  34. ACE_NEW_RETURN(sh, RealmSocket, -1);
  35. sh->reactor(reactor());
  36. sh->set_session(new AuthSocket(*sh));
  37. return 0;
  38. }
  39. };
  40. #endif