This commit is contained in:
ahmed committed 2020-01-26 14:58:34 +03:00
1 parent 61a1683c26
commit eca142b37b
2 files changed
+25 -18

No files matched your search

+2 -3
View File
@@ -298,13 +298,12 @@ namespace Esyur.Net.HTTP
if (n <= 0)
break;
Thread.Sleep(50);
//Thread.Sleep(50);
base.Send(buffer, 0, n);
}
}
}
catch
{
+23 -15
View File
@@ -55,6 +55,8 @@ namespace Esyur.Net
public event DestroyedEvent OnDestroy;
object receivingLock = new object();
object sendLock = new object();
bool processing = false;
@@ -260,33 +262,39 @@ namespace Esyur.Net
public virtual void Send(byte[] msg)
{
try
lock (sendLock)
{
if (sock != null)
try
{
lastAction = DateTime.Now;
sock.Send(msg);
if (sock != null)
{
lastAction = DateTime.Now;
sock.Send(msg);
}
}
}
catch
{
catch
{
}
}
}
public virtual void Send(byte[] msg, int offset, int length)
{
try
lock (sendLock)
{
if (sock != null)
try
{
lastAction = DateTime.Now;
sock.Send(msg, offset, length);
if (sock != null)
{
lastAction = DateTime.Now;
sock.Send(msg, offset, length);
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}