Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hemei
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
潘栩锋
hemei
Commits
b92d8fb2
Commit
b92d8fb2
authored
Jan 20, 2019
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加 Modbus.ServerTCP.cs 的线程版本
parent
80afe529
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
635 additions
and
1 deletion
+635
-1
FLY.ModbusMapper.csproj
...FLY.ModbusMapper/FLY.ModbusMapper/FLY.ModbusMapper.csproj
+2
-0
ClientTCP.cs
...FLY.ModbusMapper/FLY.ModbusMapper/WithThread/ClientTCP.cs
+1
-1
IModbusClient.cs
...ModbusMapper/FLY.ModbusMapper/WithThread/IModbusClient.cs
+26
-0
IModbusServer.cs
...ModbusMapper/FLY.ModbusMapper/WithThread/IModbusServer.cs
+48
-0
ServerTCP.cs
...FLY.ModbusMapper/FLY.ModbusMapper/WithThread/ServerTCP.cs
+558
-0
No files found.
Project.FLY.ModbusMapper/FLY.ModbusMapper/FLY.ModbusMapper.csproj
View file @
b92d8fb2
...
...
@@ -61,7 +61,9 @@
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"WithThread\ClientTCP.cs"
/>
<Compile
Include=
"WithThread\IModbusClient.cs"
/>
<Compile
Include=
"WithThread\IModbusServer.cs"
/>
<Compile
Include=
"WithThread\ModbusMapper_Client.cs"
/>
<Compile
Include=
"WithThread\ServerTCP.cs"
/>
</ItemGroup>
<ItemGroup>
<ProjectReference
Include=
"..\..\Project.FLY.FObjSys\FObjSys\FObjBase.csproj"
>
...
...
Project.FLY.ModbusMapper/FLY.ModbusMapper/WithThread/ClientTCP.cs
View file @
b92d8fb2
...
...
@@ -21,7 +21,7 @@ namespace FLY.Modbus.WithThread
/// </summary>
public
TimeSpan
Timeout
{
get
;
set
;
}
=
TimeSpan
.
FromSeconds
(
2
);
/// <summary>
/// socket 错误信息
,带时间
/// socket 错误信息
/// </summary>
public
string
ErrMsg
{
get
;
set
;
}
...
...
Project.FLY.ModbusMapper/FLY.ModbusMapper/WithThread/IModbusClient.cs
View file @
b92d8fb2
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Net
;
using
System.Text
;
namespace
FLY.Modbus.WithThread
...
...
@@ -16,6 +17,31 @@ namespace FLY.Modbus.WithThread
/// </summary>
TimeSpan
Timeout
{
get
;
set
;
}
/// <summary>
/// socket 错误信息
/// </summary>
string
ErrMsg
{
get
;
set
;
}
/// <summary>
/// 连接成功
/// </summary>
bool
IsConnected
{
get
;
set
;
}
/// <summary>
/// 远端地址
/// </summary>
IPEndPoint
RemoteEP
{
get
;
set
;
}
/// <summary>
/// 建立连接
/// </summary>
bool
Connect
();
/// <summary>
/// 停止
/// </summary>
void
Close
();
/// <summary>
/// 读多个 COIL
/// </summary>
...
...
Project.FLY.ModbusMapper/FLY.ModbusMapper/WithThread/IModbusServer.cs
0 → 100644
View file @
b92d8fb2
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Net
;
using
System.Text
;
namespace
FLY.Modbus.WithThread
{
public
interface
IModbusServer
{
/// <summary>
/// 通信超时, client 长时间连接上,但不通讯,会被断开
/// </summary>
TimeSpan
Timeout
{
get
;
set
;
}
/// <summary>
/// 本地地址
/// </summary>
IPEndPoint
LocalEP
{
get
;
set
;
}
/// <summary>
/// 当前连接数
/// </summary>
int
ConnectedCnt
{
get
;
}
/// <summary>
/// 工作中
/// </summary>
bool
IsRunning
{
get
;
set
;
}
/// <summary>
/// socket 错误信息
/// </summary>
string
ErrMsg
{
get
;
set
;
}
GetValueHander
GetValue
{
get
;
}
SetValueHander
SetValue
{
get
;
}
void
Start
();
void
Stop
();
}
public
delegate
void
GetValueHander
(
int
addr
,
object
values
);
public
delegate
void
SetValueHander
(
int
addr
,
object
values
);
}
Project.FLY.ModbusMapper/FLY.ModbusMapper/WithThread/ServerTCP.cs
0 → 100644
View file @
b92d8fb2
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment