diff options
author | Subv <subv2112@gmail.com> | 2016-12-05 17:02:08 +0100 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2016-12-05 17:02:08 +0100 |
commit | dd8887c8cfbb6d3010dde240278a3d4018c5dd85 (patch) | |
tree | 9990a463d5daccdab41ae9c90a5c698aed0d4795 /src/core/hle/kernel/client_port.cpp | |
parent | Declare empty ServerSession and ClientSession constructors as default. (diff) | |
download | yuzu-dd8887c8cfbb6d3010dde240278a3d4018c5dd85.tar yuzu-dd8887c8cfbb6d3010dde240278a3d4018c5dd85.tar.gz yuzu-dd8887c8cfbb6d3010dde240278a3d4018c5dd85.tar.bz2 yuzu-dd8887c8cfbb6d3010dde240278a3d4018c5dd85.tar.lz yuzu-dd8887c8cfbb6d3010dde240278a3d4018c5dd85.tar.xz yuzu-dd8887c8cfbb6d3010dde240278a3d4018c5dd85.tar.zst yuzu-dd8887c8cfbb6d3010dde240278a3d4018c5dd85.zip |
Diffstat (limited to 'src/core/hle/kernel/client_port.cpp')
-rw-r--r-- | src/core/hle/kernel/client_port.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/hle/kernel/client_port.cpp b/src/core/hle/kernel/client_port.cpp index 5ee7679eb..f25cb48dd 100644 --- a/src/core/hle/kernel/client_port.cpp +++ b/src/core/hle/kernel/client_port.cpp @@ -13,10 +13,18 @@ namespace Kernel { ClientPort::ClientPort() {} ClientPort::~ClientPort() {} -void ClientPort::AddWaitingSession(SharedPtr<ServerSession> server_session) { +SharedPtr<ClientSession> ClientPort::Connect() { + // Create a new session pair, let the created sessions inherit the parent port's HLE handler. + auto sessions = ServerSession::CreateSessionPair(server_port->GetName(), server_port->hle_handler); + auto client_session = std::get<SharedPtr<ClientSession>>(sessions); + auto server_session = std::get<SharedPtr<ServerSession>>(sessions); + server_port->pending_sessions.push_back(server_session); + // Wake the threads waiting on the ServerPort server_port->WakeupAllWaitingThreads(); + + return std::move(client_session); } } // namespace |