aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs26
1 files changed, 20 insertions, 6 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs b/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs
index af9b3881..b2b3d052 100644
--- a/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs
+++ b/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs
@@ -1,11 +1,12 @@
-using Ryujinx.Common;
-using Ryujinx.Common.Logging;
+using Ryujinx.Common.Logging;
using Ryujinx.HLE.Utilities;
+using System;
using System.Buffers.Binary;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Text;
+using System.Threading;
namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
{
@@ -379,13 +380,26 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
}
}
- try
+ if (fdsCount != 0)
+ {
+ try
+ {
+ System.Net.Sockets.Socket.Select(readEvents, writeEvents, errorEvents, timeout);
+ }
+ catch (SocketException exception)
+ {
+ return WriteWinSock2Error(context, (WsaError)exception.ErrorCode);
+ }
+ }
+ else if (timeout == -1)
{
- System.Net.Sockets.Socket.Select(readEvents, writeEvents, errorEvents, timeout);
+ // FIXME: If we get a timeout of -1 and there is no fds to wait on, this should kill the KProces. (need to check that with re)
+ throw new InvalidOperationException();
}
- catch (SocketException exception)
+ else
{
- return WriteWinSock2Error(context, (WsaError)exception.ErrorCode);
+ // FIXME: We should make the KThread sleep but we can't do much about it yet.
+ Thread.Sleep(timeout);
}
for (int i = 0; i < fdsCount; i++)