Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
82739c72
Commit
82739c72
authored
Feb 12, 2014
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Modbus): попытка включить keepAlive для соединения
parent
197713a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
start_fg_mbtcp.sh
extensions/ModbusMaster/start_fg_mbtcp.sh
+2
-2
ModbusTCPMaster.cc
src/Communications/Modbus/ModbusTCPMaster.cc
+2
-0
No files found.
extensions/ModbusMaster/start_fg_mbtcp.sh
View file @
82739c72
...
...
@@ -4,11 +4,11 @@
--confile
test.xml
\
--mbtcp-name
MBMaster1
\
--smemory-id
SharedMemory
\
--dlog-add-levels
info,crit,warn,level4,level3
\
--dlog-add-levels
info,crit,warn,level4,level3
,level9
\
--mbtcp-set-prop-prefix
\
--mbtcp-filter-field
rs
\
--mbtcp-filter-value
5
\
--mbtcp-gateway-iaddr
1
27.0.0.1
\
--mbtcp-gateway-iaddr
1
92.168.1.42
\
--mbtcp-gateway-port
2048
\
--mbtcp-recv-timeout
5000
\
--mbtcp-force-disconnect
1
\
...
...
src/Communications/Modbus/ModbusTCPMaster.cc
View file @
82739c72
...
...
@@ -314,6 +314,7 @@ void ModbusTCPMaster::reconnect()
// TCPStream (const char *name, Family family=IPV4, unsigned mss=536, bool throwflag=false, timeout_t timer=0)
tcp
=
new
ost
::
TCPStream
(
iaddr
.
c_str
(),
ost
::
Socket
::
IPV4
,
536
,
true
,
500
);
tcp
->
setTimeout
(
replyTimeOut_ms
);
tcp
->
setKeepAlive
(
true
);
}
catch
(
std
::
exception
&
e
)
{
...
...
@@ -365,6 +366,7 @@ void ModbusTCPMaster::connect( ost::InetAddress addr, int port )
{
tcp
=
new
ost
::
TCPStream
(
iaddr
.
c_str
(),
ost
::
Socket
::
IPV4
,
536
,
true
,
500
);
tcp
->
setTimeout
(
replyTimeOut_ms
);
tcp
->
setKeepAlive
(
true
);
}
catch
(
std
::
exception
&
e
)
{
...
...
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