client_session.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2016 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include "common/assert.h"
  5. #include "core/hle/kernel/client_session.h"
  6. #include "core/hle/kernel/errors.h"
  7. #include "core/hle/kernel/hle_ipc.h"
  8. #include "core/hle/kernel/server_session.h"
  9. namespace Kernel {
  10. ClientSession::ClientSession() = default;
  11. ClientSession::~ClientSession() {
  12. // This destructor will be called automatically when the last ClientSession handle is closed by
  13. // the emulated application.
  14. if (parent->server) {
  15. if (parent->server->hle_handler)
  16. parent->server->hle_handler->ClientDisconnected(parent->server);
  17. // TODO(Subv): Force a wake up of all the ServerSession's waiting threads and set
  18. // their WaitSynchronization result to 0xC920181A.
  19. }
  20. parent->client = nullptr;
  21. }
  22. ResultCode ClientSession::SendSyncRequest() {
  23. // Signal the server session that new data is available
  24. if (parent->server)
  25. return parent->server->HandleSyncRequest();
  26. return ERR_SESSION_CLOSED_BY_REMOTE;
  27. }
  28. } // namespace