From ddfabf31330c0c8e0558a714b6d7e1f1948b73ed Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 4 Jan 2017 23:23:17 -0500 Subject: Kernel: Use a Session object to keep track of the status of a Client/Server session pair. Reduce the associated port's connection count when a ServerSession is destroyed. --- src/core/hle/kernel/client_session.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/core/hle/kernel/client_session.h') diff --git a/src/core/hle/kernel/client_session.h b/src/core/hle/kernel/client_session.h index ed468dec6..adb2d0b5f 100644 --- a/src/core/hle/kernel/client_session.h +++ b/src/core/hle/kernel/client_session.h @@ -14,6 +14,7 @@ namespace Kernel { class ServerSession; +class Session; enum class SessionStatus { Open = 1, @@ -44,8 +45,10 @@ public: */ ResultCode SendSyncRequest(); - std::string name; ///< Name of client port (optional) - ServerSession* server_session; ///< The server session associated with this client session. + std::string name; ///< Name of client port (optional) + + /// The parent session, which links to the server endpoint. + std::shared_ptr parent; SessionStatus session_status; ///< The session's current status. private: @@ -54,12 +57,10 @@ private: /** * Creates a client session. - * @param server_session The server session associated with this client session * @param name Optional name of client session * @return The created client session */ - static ResultVal> Create(ServerSession* server_session, - std::string name = "Unknown"); + static ResultVal> Create(std::string name = "Unknown"); }; } // namespace -- cgit v1.2.3 From ce5bc477ca0cd59df4922c1c6cd245db365dc7bc Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 4 Jan 2017 23:24:06 -0500 Subject: Kernel: Remove a now unused enum and variable regarding a session's status. --- src/core/hle/kernel/client_session.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/core/hle/kernel/client_session.h') diff --git a/src/core/hle/kernel/client_session.h b/src/core/hle/kernel/client_session.h index adb2d0b5f..5ec4ee901 100644 --- a/src/core/hle/kernel/client_session.h +++ b/src/core/hle/kernel/client_session.h @@ -16,12 +16,6 @@ namespace Kernel { class ServerSession; class Session; -enum class SessionStatus { - Open = 1, - ClosedByClient = 2, - ClosedBYServer = 3, -}; - class ClientSession final : public Object { public: friend class ServerSession; @@ -49,7 +43,6 @@ public: /// The parent session, which links to the server endpoint. std::shared_ptr parent; - SessionStatus session_status; ///< The session's current status. private: ClientSession(); -- cgit v1.2.3 From 37347bfa380464a1ee1236d2a35f1ec1b697e4b6 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 21 May 2017 18:52:42 -0500 Subject: Kernel/Sessions: Remove the ClientSession::Create function. It is not meant to be used by anything other than CreateSessionPair. --- src/core/hle/kernel/client_session.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/core/hle/kernel/client_session.h') diff --git a/src/core/hle/kernel/client_session.h b/src/core/hle/kernel/client_session.h index 5ec4ee901..9f3adb72b 100644 --- a/src/core/hle/kernel/client_session.h +++ b/src/core/hle/kernel/client_session.h @@ -47,13 +47,6 @@ public: private: ClientSession(); ~ClientSession() override; - - /** - * Creates a client session. - * @param name Optional name of client session - * @return The created client session - */ - static ResultVal> Create(std::string name = "Unknown"); }; } // namespace -- cgit v1.2.3