mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2025-06-26 21:13:13 +00:00
AsyncReply thread safe
This commit is contained in:
@ -285,13 +285,15 @@ namespace Esiur.Net.IIP
|
||||
|
||||
void init()
|
||||
{
|
||||
queue.Then((x) =>
|
||||
var q = queue;
|
||||
q.Then((x) =>
|
||||
{
|
||||
if (x.Type == DistributedResourceQueueItem.DistributedResourceQueueItemType.Event)
|
||||
x.Resource._EmitEventByIndex(x.Index, (object[])x.Value);
|
||||
else
|
||||
x.Resource._UpdatePropertyByIndex(x.Index, x.Value);
|
||||
});
|
||||
//q.timeout?.Dispose();
|
||||
|
||||
var r = new Random();
|
||||
localNonce = new byte[32];
|
||||
|
@ -179,7 +179,9 @@ namespace Esiur.Net
|
||||
listener = socket;
|
||||
|
||||
// Start accepting
|
||||
listener.Accept().Then(NewConnection);
|
||||
var r = listener.Accept();
|
||||
r.Then(NewConnection);
|
||||
//r.timeout?.Dispose();
|
||||
|
||||
//var rt = listener.Accept().Then()
|
||||
//thread = new Thread(new System.Threading.ThreadStart(ListenForConnections));
|
||||
@ -303,8 +305,11 @@ namespace Esiur.Net
|
||||
// something wrong with the child.
|
||||
}
|
||||
|
||||
// Accept more
|
||||
listener.Accept().Then(NewConnection);
|
||||
// Accept more
|
||||
var l = listener.Accept();
|
||||
|
||||
l.Then(NewConnection);
|
||||
//l.timeout?.Dispose();
|
||||
|
||||
sock.Begin();
|
||||
|
||||
|
Reference in New Issue
Block a user