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
cb081e64
Commit
cb081e64
authored
Nov 21, 2016
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(UNetUDP): исправление ошибки с переключением канала приёма
parent
30d0c144
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
5 deletions
+30
-5
libuniset2.spec
conf/libuniset2.spec
+4
-1
UNetExchange.cc
extensions/UNetUDP/UNetExchange.cc
+9
-2
UNetReceiver.cc
extensions/UNetUDP/UNetReceiver.cc
+16
-2
UNetReceiver.h
extensions/UNetUDP/UNetReceiver.h
+1
-0
No files found.
conf/libuniset2.spec
View file @
cb081e64
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
Name: libuniset2
Name: libuniset2
Version: 2.6
Version: 2.6
Release: alt
1
Release: alt
2
Summary: UniSet - library for building distributed industrial control systems
Summary: UniSet - library for building distributed industrial control systems
License: LGPL
License: LGPL
...
@@ -508,6 +508,9 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
...
@@ -508,6 +508,9 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
# history of current unpublished changes
# history of current unpublished changes
%changelog
%changelog
* Mon Nov 21 2016 Pavel Vainerman <pv@altlinux.ru> 2.6-alt2
- UNet: fixed bug in change receive channel
* Fri Nov 11 2016 Pavel Vainerman <pv@altlinux.ru> 2.6-alt1
* Fri Nov 11 2016 Pavel Vainerman <pv@altlinux.ru> 2.6-alt1
- build new version
- build new version
- remove 'fastSaveValue'
- remove 'fastSaveValue'
...
...
extensions/UNetUDP/UNetExchange.cc
View file @
cb081e64
...
@@ -589,8 +589,15 @@ void UNetExchange::sysCommand( const uniset::SystemMessage* sm )
...
@@ -589,8 +589,15 @@ void UNetExchange::sysCommand( const uniset::SystemMessage* sm )
{
{
if
(
!
logserv_host
.
empty
()
&&
logserv_port
!=
0
&&
!
logserv
->
isRunning
()
)
if
(
!
logserv_host
.
empty
()
&&
logserv_port
!=
0
&&
!
logserv
->
isRunning
()
)
{
{
unetinfo
<<
myname
<<
"(init): run log server "
<<
logserv_host
<<
":"
<<
logserv_port
<<
endl
;
try
logserv
->
run
(
logserv_host
,
logserv_port
,
true
);
{
unetinfo
<<
myname
<<
"(init): run log server "
<<
logserv_host
<<
":"
<<
logserv_port
<<
endl
;
logserv
->
run
(
logserv_host
,
logserv_port
,
true
);
}
catch
(
std
::
exception
&
ex
)
{
unetwarn
<<
myname
<<
"(init): run logserver FAILED. ERR: "
<<
ex
.
what
()
<<
endl
;
}
}
}
waitSMReady
();
waitSMReady
();
...
...
extensions/UNetUDP/UNetReceiver.cc
View file @
cb081e64
...
@@ -479,6 +479,9 @@ void UNetReceiver::updateThread() noexcept
...
@@ -479,6 +479,9 @@ void UNetReceiver::updateThread() noexcept
unetcrit
<<
myname
<<
"(update_thread): "
<<
ex
.
what
()
<<
endl
;
unetcrit
<<
myname
<<
"(update_thread): "
<<
ex
.
what
()
<<
endl
;
}
}
// смотрим есть ли связь..
checkConnection
();
if
(
sidRespond
!=
DefaultObjectId
)
if
(
sidRespond
!=
DefaultObjectId
)
{
{
try
try
...
@@ -525,8 +528,6 @@ void UNetReceiver::readEvent( ev::io& watcher ) noexcept
...
@@ -525,8 +528,6 @@ void UNetReceiver::readEvent( ev::io& watcher ) noexcept
if
(
!
activated
)
if
(
!
activated
)
return
;
return
;
bool
tout
=
false
;
try
try
{
{
if
(
receive
()
)
if
(
receive
()
)
...
@@ -543,6 +544,11 @@ void UNetReceiver::readEvent( ev::io& watcher ) noexcept
...
@@ -543,6 +544,11 @@ void UNetReceiver::readEvent( ev::io& watcher ) noexcept
{
{
unetwarn
<<
myname
<<
"(receive): "
<<
e
.
what
()
<<
std
::
endl
;
unetwarn
<<
myname
<<
"(receive): "
<<
e
.
what
()
<<
std
::
endl
;
}
}
}
// -----------------------------------------------------------------------------
void
UNetReceiver
::
checkConnection
()
{
bool
tout
=
false
;
// делаем через промежуточную переменную
// делаем через промежуточную переменную
// чтобы поскорее освободить mutex
// чтобы поскорее освободить mutex
...
@@ -590,6 +596,9 @@ void UNetReceiver::updateEvent( ev::periodic& tm, int revents ) noexcept
...
@@ -590,6 +596,9 @@ void UNetReceiver::updateEvent( ev::periodic& tm, int revents ) noexcept
unetcrit
<<
myname
<<
"(updateEvent): "
<<
ex
.
what
()
<<
std
::
endl
;
unetcrit
<<
myname
<<
"(updateEvent): "
<<
ex
.
what
()
<<
std
::
endl
;
}
}
// смотрим есть ли связь..
checkConnection
();
if
(
sidRespond
!=
DefaultObjectId
)
if
(
sidRespond
!=
DefaultObjectId
)
{
{
try
try
...
@@ -676,6 +685,11 @@ bool UNetReceiver::receive() noexcept
...
@@ -676,6 +685,11 @@ bool UNetReceiver::receive() noexcept
unetcrit
<<
myname
<<
"(receive): recv err: "
<<
ex
.
displayText
()
<<
endl
;
unetcrit
<<
myname
<<
"(receive): recv err: "
<<
ex
.
displayText
()
<<
endl
;
return
false
;
return
false
;
}
}
catch
(
exception
&
ex
)
{
unetcrit
<<
myname
<<
"(receive): recv err: "
<<
ex
.
what
()
<<
endl
;
return
false
;
}
if
(
pack
.
magic
!=
UniSetUDP
::
UNETUDP_MAGICNUM
)
if
(
pack
.
magic
!=
UniSetUDP
::
UNETUDP_MAGICNUM
)
{
{
...
...
extensions/UNetUDP/UNetReceiver.h
View file @
cb081e64
...
@@ -224,6 +224,7 @@ class UNetReceiver:
...
@@ -224,6 +224,7 @@ class UNetReceiver:
void
initIterators
()
noexcept
;
void
initIterators
()
noexcept
;
bool
createConnection
(
bool
throwEx
=
false
);
bool
createConnection
(
bool
throwEx
=
false
);
void
checkConnection
();
public
:
public
:
...
...
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