Skip to content

Commit

Permalink
修改dp2sipclient接管消息异常
Browse files Browse the repository at this point in the history
  • Loading branch information
renyh committed Sep 13, 2022
1 parent 22d84d4 commit 46ab4bf
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 34 deletions.
74 changes: 46 additions & 28 deletions dp2SIPClient/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -567,27 +567,37 @@ private void sendCmd()
return;
}

string requestText = this.txtMsg.Text.Trim() + new string((char)13, 1); // 2018/7/28
string responseText = "";
string error = "";
try
{

this.Print("send:" + requestText);
LogManager.Logger.Info("send:" + requestText);
BaseMessage response = null;
int nRet = SCHelper.Instance.SendAndRecvMessage(requestText,
out response,
out responseText,
out error);
if (nRet == -1)
string requestText = this.txtMsg.Text.Trim() + new string((char)13, 1); // 2018/7/28
string responseText = "";
string error = "";

this.Print("send:" + requestText);
LogManager.Logger.Info("send:" + requestText);
BaseMessage response = null;
int nRet = SCHelper.Instance.SendAndRecvMessage(requestText,
out response,
out responseText,
out error);
if (nRet == -1)
{
MessageBox.Show(error);
this.Print("error:" + error);
LogManager.Logger.Error("error:" + error);
return;
}

this.Print("recv:" + responseText);
LogManager.Logger.Info("recv:" + responseText);
}
catch (Exception ex)
{
MessageBox.Show(error);
this.Print("error:" + error);
LogManager.Logger.Error("error:" + error);
MessageBox.Show(this,ex.Message);
return;
}

this.Print("recv:" + responseText);
LogManager.Logger.Info("recv:" + responseText);

}

Expand Down Expand Up @@ -1205,20 +1215,28 @@ private void button1_Click(object sender, EventArgs e)

public void SendMessage()
{
string cmdText = this.textBox_message.Text.Trim();//this.textBox_barcodes.Text.Trim();
this.Print("send:" + cmdText);
BaseMessage response = null;
int nRet = SCHelper.Instance.SendAndRecvMessage(cmdText,
out response,
out string responseText,
out string error);
if (nRet == -1)
try
{
MessageBox.Show(error);
this.Print("error:" + error);
}
string cmdText = this.textBox_message.Text.Trim();//this.textBox_barcodes.Text.Trim();
this.Print("send:" + cmdText);
BaseMessage response = null;
int nRet = SCHelper.Instance.SendAndRecvMessage(cmdText,
out response,
out string responseText,
out string error);
if (nRet == -1)
{
MessageBox.Show(error);
this.Print("error:" + error);
}

this.Print("recv:" + responseText);
this.Print("recv:" + responseText);
}
catch (Exception ex)
{
MessageBox.Show(this,ex.Message);
return;
}
}


Expand Down
7 changes: 3 additions & 4 deletions dp2SIPClient/dp2SIPClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<ManifestCertificateThumbprint>57CE53D10A26B55C487F4A07A2D6B3BCCB573D75</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>数字平台(北京)软件有限责任公司_2022.pfx</ManifestKeyFile>
<ManifestKeyFile>数字平台(北京)软件有限责任公司.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
Expand All @@ -77,8 +77,8 @@
<ManifestTimestampUrl>http://timestamp.digicert.com</ManifestTimestampUrl>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
Expand Down Expand Up @@ -175,7 +175,6 @@
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<None Include="数字平台(北京)软件有限责任公司.pfx" />
<None Include="数字平台(北京)软件有限责任公司_2022.pfx" />
</ItemGroup>
<ItemGroup>
<Content Include="delete.txt" />
Expand Down
2 changes: 1 addition & 1 deletion dp2SIPClient/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.12" targetFramework="net461" />
<package id="log4net" version="2.0.15" targetFramework="net472" />
</packages>

0 comments on commit 46ab4bf

Please sign in to comment.