mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-10-29 04:06:51 +00:00
sendLock
This commit is contained in:
1 parent
61a1683c26
commit
eca142b37b
2 files changed
+9
-2
No files matched your search
@@ -298,13 +298,12 @@ namespace Esyur.Net.HTTP
|
||||
if (n <= 0)
|
||||
break;
|
||||
|
||||
Thread.Sleep(50);
|
||||
//Thread.Sleep(50);
|
||||
base.Send(buffer, 0, n);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@@ -55,6 +55,8 @@ namespace Esyur.Net
|
||||
public event DestroyedEvent OnDestroy;
|
||||
object receivingLock = new object();
|
||||
|
||||
object sendLock = new object();
|
||||
|
||||
bool processing = false;
|
||||
|
||||
|
||||
@@ -259,6 +261,8 @@ namespace Esyur.Net
|
||||
*/
|
||||
|
||||
public virtual void Send(byte[] msg)
|
||||
{
|
||||
lock (sendLock)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -273,8 +277,11 @@ namespace Esyur.Net
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Send(byte[] msg, int offset, int length)
|
||||
{
|
||||
lock (sendLock)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -289,6 +296,7 @@ namespace Esyur.Net
|
||||
Console.WriteLine(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Send(string data)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user