|
@@ -1,6 +1,6 @@
|
|
|
using System;
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
|
-using System.IO;
|
|
|
|
|
|
|
+using System.Linq;
|
|
|
using System.Net;
|
|
using System.Net;
|
|
|
using System.Net.WebSockets;
|
|
using System.Net.WebSockets;
|
|
|
|
|
|
|
@@ -16,18 +16,18 @@ namespace ET
|
|
|
|
|
|
|
|
public ThreadSynchronizationContext ThreadSynchronizationContext;
|
|
public ThreadSynchronizationContext ThreadSynchronizationContext;
|
|
|
|
|
|
|
|
- public WService(IEnumerable<string> prefixs, ILog log): base(log)
|
|
|
|
|
|
|
+ public WService(ThreadSynchronizationContext threadSynchronizationContext, IEnumerable<string> prefixs, ILog log): base(log)
|
|
|
{
|
|
{
|
|
|
- this.ThreadSynchronizationContext = new ThreadSynchronizationContext();
|
|
|
|
|
|
|
+ this.ThreadSynchronizationContext = threadSynchronizationContext;
|
|
|
|
|
|
|
|
this.httpListener = new HttpListener();
|
|
this.httpListener = new HttpListener();
|
|
|
|
|
|
|
|
StartAccept(prefixs).Coroutine();
|
|
StartAccept(prefixs).Coroutine();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public WService(ILog log): base(log)
|
|
|
|
|
|
|
+ public WService(ThreadSynchronizationContext threadSynchronizationContext, ILog log): base(log)
|
|
|
{
|
|
{
|
|
|
- this.ThreadSynchronizationContext = new ThreadSynchronizationContext();
|
|
|
|
|
|
|
+ this.ThreadSynchronizationContext = threadSynchronizationContext;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private long GetId
|
|
private long GetId
|
|
@@ -45,6 +45,10 @@ namespace ET
|
|
|
this.channels[channel.Id] = channel;
|
|
this.channels[channel.Id] = channel;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public override void Update()
|
|
|
|
|
+ {
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public override void Remove(long id, int error = 0)
|
|
public override void Remove(long id, int error = 0)
|
|
|
{
|
|
{
|
|
|
WChannel channel;
|
|
WChannel channel;
|
|
@@ -116,7 +120,7 @@ namespace ET
|
|
|
{
|
|
{
|
|
|
if (e.ErrorCode == 5)
|
|
if (e.ErrorCode == 5)
|
|
|
{
|
|
{
|
|
|
- throw new Exception($"CMD管理员中输入: netsh http add urlacl url=http://*:8080/ user=Everyone", e);
|
|
|
|
|
|
|
+ throw new Exception($"CMD管理员中输入: netsh http add urlacl url=http://*:8080/ user=Everyone {prefixs.ToList().ListToString()}", e);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Log.Error(e);
|
|
Log.Error(e);
|
|
@@ -136,10 +140,5 @@ namespace ET
|
|
|
}
|
|
}
|
|
|
channel.Send(message);
|
|
channel.Send(message);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- public override void Update()
|
|
|
|
|
- {
|
|
|
|
|
- this.ThreadSynchronizationContext.Update();
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|