From 20598960a52b9e9ebe9255335e0734ad3cbe124c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Francart?= <38794835+Refragg@users.noreply.github.com> Date: Thu, 8 Aug 2024 20:08:28 +0200 Subject: [PATCH] PINE: Fix socket naming for Mac and Linux to match protocol specification (#15906) This commit fixes the socket file name for Mac and Linux users. Essentially, the port is now only concatenated to the socket name if it is different than the default port. This change was made to match with the specification of the PINE protocol and the other emulators implementing it. --- 3rdparty/pine/pine_server.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/3rdparty/pine/pine_server.h b/3rdparty/pine/pine_server.h index 44f2ab7087..df985cfb62 100644 --- a/3rdparty/pine/pine_server.h +++ b/3rdparty/pine/pine_server.h @@ -4,7 +4,12 @@ #pragma once -//#include "Utilities/Thread.h" +// IPC uses a concept of "slot" to be able to communicate with multiple +// emulators at the same time, each slot should be unique to each emulator to +// allow PnP and configurable by the end user so that several runs don't +// conflict with each others +#define IPC_DEFAULT_SLOT 28012 + #include #include "stdafx.h" #include @@ -568,7 +573,11 @@ namespace pine m_socket_name += "/rpcs3.sock"; } - m_socket_name = fmt::format("%s.%d", m_socket_name, Impl::get_port()); + const int slot = Impl::get_port(); + if (slot != IPC_DEFAULT_SLOT) + { + fmt::append(m_socket_name, ".%d", slot); + } struct sockaddr_un server;