client_port.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright 2016 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <string>
  6. #include "common/common_types.h"
  7. #include "core/hle/kernel/kernel.h"
  8. namespace Kernel {
  9. class ServerPort;
  10. class ServerSession;
  11. class ClientPort final : public Object {
  12. public:
  13. friend class ServerPort;
  14. std::string GetTypeName() const override {
  15. return "ClientPort";
  16. }
  17. std::string GetName() const override {
  18. return name;
  19. }
  20. static const HandleType HANDLE_TYPE = HandleType::ClientPort;
  21. HandleType GetHandleType() const override {
  22. return HANDLE_TYPE;
  23. }
  24. /**
  25. * Adds the specified server session to the queue of pending sessions of the associated ServerPort
  26. * @param server_session Server session to add to the queue
  27. */
  28. void AddWaitingSession(SharedPtr<ServerSession> server_session);
  29. SharedPtr<ServerPort> server_port; ///< ServerPort associated with this client port.
  30. u32 max_sessions; ///< Maximum number of simultaneous sessions the port can have
  31. u32 active_sessions; ///< Number of currently open sessions to this port
  32. std::string name; ///< Name of client port (optional)
  33. private:
  34. ClientPort();
  35. ~ClientPort() override;
  36. };
  37. } // namespace