Synchronize ManagerConnection socket writes to make SendAction thread safe
This commit is contained in:
parent
03f51ba65e
commit
bc65355dda
|
@ -45,6 +45,7 @@ namespace AsterNET.Manager
|
|||
private int pingInterval = 10000;
|
||||
|
||||
private object lockSocket = new object();
|
||||
private object lockSocketWrite = new object();
|
||||
private object lockHandlers = new object();
|
||||
|
||||
private bool enableEvents = true;
|
||||
|
@ -1506,7 +1507,10 @@ namespace AsterNET.Manager
|
|||
|
||||
private void sendToAsterisk(string buffer)
|
||||
{
|
||||
mrSocket.Write(buffer);
|
||||
lock (lockSocketWrite)
|
||||
{
|
||||
mrSocket.Write(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
Loading…
Reference in a new issue