From 9c2ba6a58761bb2cfdfbba7f9532fb6ddb5e4480 Mon Sep 17 00:00:00 2001 From: Jack Date: Fri, 31 Jul 2020 10:25:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E7=A9=BA=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=EF=BC=8C=E5=8F=AF=E5=8F=91=E9=80=81=200x0=200x0=200x0=200x0=20?= =?UTF-8?q?=E7=9B=91=E6=B5=8B=E5=90=84=E4=B8=AA=E6=9C=8D=E5=8A=A1=E7=AB=AF?= =?UTF-8?q?=E5=81=A5=E5=BA=B7=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JMS.Gateway.Referee/Impls/RequestReception.cs | 5 +++++ JMS.Gateway/Impls/RequestReception.cs | 5 +++++ JMS.Proxy/Connect.cs | 6 ++++++ JMS.ServiceProvider/Impls/RequestReception.cs | 5 +++++ JMS.ServiceProvider/JMS.ServiceProvider.csproj | 2 +- 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/JMS.Gateway.Referee/Impls/RequestReception.cs b/JMS.Gateway.Referee/Impls/RequestReception.cs index fc3e34ae..c33bc8e8 100644 --- a/JMS.Gateway.Referee/Impls/RequestReception.cs +++ b/JMS.Gateway.Referee/Impls/RequestReception.cs @@ -25,6 +25,11 @@ public void Interview(Socket socket) using (var client = new NetClient(socket)) { var cmd = client.ReadServiceObject(); + if (cmd == null) + { + client.Write(Encoding.UTF8.GetBytes("ok")); + return; + } _logger?.LogDebug("收到命令,type:{0} content:{1}", cmd.Type, cmd.Content); _manager.AllocHandler(cmd)?.Handle(client, cmd); diff --git a/JMS.Gateway/Impls/RequestReception.cs b/JMS.Gateway/Impls/RequestReception.cs index b9c6481e..68c35d7f 100644 --- a/JMS.Gateway/Impls/RequestReception.cs +++ b/JMS.Gateway/Impls/RequestReception.cs @@ -50,6 +50,11 @@ public void Interview(Socket socket) while (true) { var cmd = client.ReadServiceObject(); + if (cmd == null) + { + client.Write(Encoding.UTF8.GetBytes("ok")); + return; + } _logger?.LogDebug("type:{0} content:{1}", cmd.Type, cmd.Content); _manager.AllocHandler(cmd)?.Handle(client, cmd); diff --git a/JMS.Proxy/Connect.cs b/JMS.Proxy/Connect.cs index eca972d0..e40ec90e 100644 --- a/JMS.Proxy/Connect.cs +++ b/JMS.Proxy/Connect.cs @@ -32,6 +32,12 @@ public void Dispose() public void Start() { var target = _client.ReadServiceObject(); + if(target == null) + { + _client.Write(Encoding.UTF8.GetBytes("ok")); + _client.Dispose(); + return; + } _logger?.LogDebug("收到转发{0} {1}", target.Address, target.Port); _targetClient = new CertClient(target, _proxy.ClientCert); diff --git a/JMS.ServiceProvider/Impls/RequestReception.cs b/JMS.ServiceProvider/Impls/RequestReception.cs index 822ac68d..1f7d5226 100644 --- a/JMS.ServiceProvider/Impls/RequestReception.cs +++ b/JMS.ServiceProvider/Impls/RequestReception.cs @@ -67,6 +67,11 @@ public void Interview(Socket socket) while (true) { var cmd = netclient.ReadServiceObject(); + if (cmd == null) + { + netclient.Write(Encoding.UTF8.GetBytes("ok")); + return; + } if (_processExitHandler.ProcessExited) return; diff --git a/JMS.ServiceProvider/JMS.ServiceProvider.csproj b/JMS.ServiceProvider/JMS.ServiceProvider.csproj index b0a637ba..c6d9b818 100644 --- a/JMS.ServiceProvider/JMS.ServiceProvider.csproj +++ b/JMS.ServiceProvider/JMS.ServiceProvider.csproj @@ -6,7 +6,7 @@ JMS.ServiceProvider true https://github.com/simpleway2016/JMS - 1.0.0.20 + 1.0.0.21 Jack.T JMS JMS