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
6bea90e7
Commit
6bea90e7
authored
May 01, 2011
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(unet2): Добавил возможность задать broadcast адрес для всех узлов сразу.
Чуть подправил логи.
parent
6c825ca4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
4 deletions
+18
-4
UNetExchange.cc
extensions/UNet2/UNetExchange.cc
+11
-1
UNetReceiver.cc
extensions/UNet2/UNetReceiver.cc
+3
-3
UNetReceiver.h
extensions/UNet2/UNetReceiver.h
+4
-0
No files found.
extensions/UNet2/UNetExchange.cc
View file @
6bea90e7
...
@@ -48,15 +48,25 @@ sender(0)
...
@@ -48,15 +48,25 @@ sender(0)
throw
UniSetTypes
::
SystemError
(
"(UNetExchange): Not found <nodes>"
);
throw
UniSetTypes
::
SystemError
(
"(UNetExchange): Not found <nodes>"
);
UniXML_iterator
n_it
(
nodes
);
UniXML_iterator
n_it
(
nodes
);
string
default_ip
(
n_it
.
getProp
(
"unet_ip"
));
if
(
!
n_it
.
goChildren
()
)
if
(
!
n_it
.
goChildren
()
)
throw
UniSetTypes
::
SystemError
(
"(UNetExchange): Items not found for <nodes>"
);
throw
UniSetTypes
::
SystemError
(
"(UNetExchange): Items not found for <nodes>"
);
for
(
;
n_it
.
getCurrent
();
n_it
.
goNext
()
)
for
(
;
n_it
.
getCurrent
();
n_it
.
goNext
()
)
{
{
// Если указано поле unet_ip непосредственно у узла - берём его
// если указано общий broadcast ip для всех узлов - берём его
// Иначе берём из поля "ip"
string
h
(
n_it
.
getProp
(
"ip"
));
string
h
(
n_it
.
getProp
(
"ip"
));
if
(
!
default_ip
.
empty
()
)
h
=
default_ip
;
if
(
!
n_it
.
getProp
(
"unet_ip"
).
empty
()
)
if
(
!
n_it
.
getProp
(
"unet_ip"
).
empty
()
)
h
=
n_it
.
getProp
(
"unet_ip"
);
h
=
n_it
.
getProp
(
"unet_ip"
);
// Если указано поле unet_port - используем его
// Иначе port = идентификатору узла
int
p
=
n_it
.
getIntProp
(
"id"
);
int
p
=
n_it
.
getIntProp
(
"id"
);
if
(
!
n_it
.
getProp
(
"unet_port"
).
empty
()
)
if
(
!
n_it
.
getProp
(
"unet_port"
).
empty
()
)
p
=
n_it
.
getIntProp
(
"unet_port"
);
p
=
n_it
.
getIntProp
(
"unet_port"
);
...
@@ -70,7 +80,7 @@ sender(0)
...
@@ -70,7 +80,7 @@ sender(0)
continue
;
continue
;
}
}
if
(
!
n_it
.
getProp
(
"unet_ignore"
).
empty
(
)
)
if
(
n_it
.
getIntProp
(
"unet_ignore"
)
)
{
{
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(init): unet_ignore.. for "
<<
n_it
.
getProp
(
"name"
)
<<
endl
;
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(init): unet_ignore.. for "
<<
n_it
.
getProp
(
"name"
)
<<
endl
;
continue
;
continue
;
...
...
extensions/UNet2/UNetReceiver.cc
View file @
6bea90e7
...
@@ -235,7 +235,7 @@ void UNetReceiver::real_update()
...
@@ -235,7 +235,7 @@ void UNetReceiver::real_update()
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void
UNetReceiver
::
receive
()
void
UNetReceiver
::
receive
()
{
{
c
err
<<
"
******************* receive start"
<<
endl
;
c
out
<<
myname
<<
":
******************* receive start"
<<
endl
;
ptRecvTimeout
.
setTiming
(
recvTimeout
);
ptRecvTimeout
.
setTiming
(
recvTimeout
);
while
(
activated
)
while
(
activated
)
{
{
...
@@ -254,13 +254,13 @@ void UNetReceiver::receive()
...
@@ -254,13 +254,13 @@ void UNetReceiver::receive()
}
}
catch
(...)
catch
(...)
{
{
cerr
<<
myname
<<
"(
p
receive): catch ..."
<<
std
::
endl
;
cerr
<<
myname
<<
"(receive): catch ..."
<<
std
::
endl
;
}
}
msleep
(
recvpause
);
msleep
(
recvpause
);
}
}
c
err
<<
"************* execut
e FINISH **********"
<<
endl
;
c
out
<<
myname
<<
": ************* receiv
e FINISH **********"
<<
endl
;
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
bool
UNetReceiver
::
recv
()
bool
UNetReceiver
::
recv
()
...
...
extensions/UNet2/UNetReceiver.h
View file @
6bea90e7
...
@@ -134,6 +134,10 @@ class UNetReceiver
...
@@ -134,6 +134,10 @@ class UNetReceiver
IOController
::
AIOStateList
::
iterator
ait
;
IOController
::
AIOStateList
::
iterator
ait
;
IOController
::
DIOStateList
::
iterator
dit
;
IOController
::
DIOStateList
::
iterator
dit
;
UniversalIO
::
IOTypes
iotype
;
UniversalIO
::
IOTypes
iotype
;
ItemInfo
()
:
id
(
UniSetTypes
::
DefaultObjectId
),
iotype
(
UniversalIO
::
UnknownIOType
){}
};
};
typedef
std
::
vector
<
ItemInfo
>
ItemVec
;
typedef
std
::
vector
<
ItemInfo
>
ItemVec
;
...
...
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