Browse Source

防火墙设置

master
忱 沈 2 weeks ago
parent
commit
bcca150aea
  1. 2
      DyeingComputer.csproj
  2. 3
      UserClass/AsyncTcpServer.cs

2
DyeingComputer.csproj

@ -33,7 +33,7 @@
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>

3
UserClass/AsyncTcpServer.cs

@ -74,6 +74,7 @@ namespace DyeingComputer.UserClass
// public static readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
public static async Task Main()
{
NetFwManger.AllowPort(7789, "TCP");//开放7790端口
NetFwManger.AllowPort(7790,"TCP");//开放7790端口
TcpService service = new TcpService();
service.Connecting = (client, e) => { return EasyTask.CompletedTask; };//有客户端正在连接
@ -892,7 +893,7 @@ namespace DyeingComputer.UserClass
await service.SetupAsync(new TouchSocketConfig()//载入配置
.SetMaxBufferSize(1024 * 1024 * 100)
.SetMinBufferSize(1024 * 1024)
.SetListenIPHosts(new IPHost[] { new IPHost("tcp://127.0.0.1:7789"), new IPHost(7790) })//同时监听两个地址
.SetListenIPHosts(new IPHost[] { new IPHost(7789), new IPHost(7790) })//同时监听两个地址
.ConfigureContainer(a =>//容器的配置顺序应该在最前面
{
})

Loading…
Cancel
Save