mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-06 11:56:26 +02:00
Add logging in socket implementation (#661)
Adds logging to most Socket calls to help with debugging network issues. Shouldn't affect any functionality. There's a small chance it could spam the log in some games.
This commit is contained in:
parent
66054dd225
commit
61975ca44d
3 changed files with 101 additions and 7 deletions
|
@ -34,6 +34,10 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
|
|||
{
|
||||
if (errorCode != LinuxError.SUCCESS)
|
||||
{
|
||||
if (errorCode != LinuxError.EWOULDBLOCK)
|
||||
{
|
||||
Logger.Warning?.Print(LogClass.ServiceBsd, $"Operation failed with error {errorCode}.");
|
||||
}
|
||||
result = -1;
|
||||
}
|
||||
|
||||
|
@ -66,6 +70,8 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
|
|||
BsdSocketType type = (BsdSocketType)context.RequestData.ReadInt32();
|
||||
ProtocolType protocol = (ProtocolType)context.RequestData.ReadInt32();
|
||||
|
||||
Logger.Info?.PrintMsg(LogClass.ServiceBsd, $"Creating socket with domain={domain}, type={type}, protocol={protocol}");
|
||||
|
||||
BsdSocketCreationFlags creationFlags = (BsdSocketCreationFlags)((int)type >> (int)BsdSocketCreationFlags.FlagsShift);
|
||||
type &= BsdSocketType.TypeMask;
|
||||
|
||||
|
@ -111,6 +117,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
|
|||
|
||||
if (exempt)
|
||||
{
|
||||
Logger.Info?.Print(LogClass.ServiceBsd, "Disconnecting exempt socket.");
|
||||
newBsdSocket.Disconnect();
|
||||
}
|
||||
|
||||
|
@ -797,7 +804,11 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
|
|||
{
|
||||
errno = socket.Listen(backlog);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
Logger.Warning?.PrintMsg(LogClass.ServiceBsd, $"Invalid socket fd '{socketFd}'.");
|
||||
}
|
||||
|
||||
return WriteBsdResult(context, 0, errno);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue