1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 02:32:36 +01:00

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.
This commit is contained in:
Jérémy Francart 2024-08-08 20:08:28 +02:00 committed by GitHub
parent 1200bbe7cc
commit 20598960a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 <string>
#include "stdafx.h"
#include <stdio.h>
@ -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;