Update Listener.cs

This commit is contained in:
NYAN CAT 2019-01-18 20:16:22 -08:00
parent 7bd1cdd7d6
commit 5a60cccb4b

View File

@ -1,6 +1,7 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Net; using System.Net;
using System.Net.Sockets; using System.Net.Sockets;
using System;
namespace AsyncRAT_Sharp.Sockets namespace AsyncRAT_Sharp.Sockets
{ {
@ -21,10 +22,21 @@ namespace AsyncRAT_Sharp.Sockets
{ {
await Task.Delay(1); await Task.Delay(1);
if (listener.Pending()) if (listener.Pending())
{
listener.BeginAcceptSocket(EndAccept, null);
}
}
}
public void EndAccept(IAsyncResult ar)
{
try
{ {
Clients CL = new Clients(); Clients CL = new Clients();
CL.InitializeClient(listener.AcceptSocket()); CL.InitializeClient(listener.EndAcceptSocket(ar));
} }
catch
{
} }
} }
} }