diff options
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 |