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
2abfbf40
Commit
2abfbf40
authored
Oct 11, 2018
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(UNet): set default prefix for log setup (default: "--unet-log")
parent
112329df
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
17 deletions
+35
-17
UNetExchange.cc
extensions/UNetUDP/UNetExchange.cc
+3
-3
UNetReceiver.cc
extensions/UNetUDP/UNetReceiver.cc
+9
-3
UNetReceiver.h
extensions/UNetUDP/UNetReceiver.h
+3
-1
UNetSender.cc
extensions/UNetUDP/UNetSender.cc
+10
-5
UNetSender.h
extensions/UNetUDP/UNetSender.h
+9
-4
start_fg.sh
extensions/UNetUDP/start_fg.sh
+1
-1
No files found.
extensions/UNetUDP/UNetExchange.cc
View file @
2abfbf40
...
...
@@ -164,7 +164,7 @@ UNetExchange::UNetExchange(uniset::ObjectId objId, uniset::ObjectId shmId, const
}
unetinfo
<<
myname
<<
"(init): init sender.. my node "
<<
n_it
.
getProp
(
"name"
)
<<
endl
;
sender
=
make_shared
<
UNetSender
>
(
h
,
p
,
shm
,
false
,
s_field
,
s_fvalue
,
prefix
);
sender
=
make_shared
<
UNetSender
>
(
h
,
p
,
shm
,
false
,
s_field
,
s_fvalue
,
"unet"
,
prefix
);
sender
->
setSendPause
(
sendpause
);
sender
->
setCheckConnectionPause
(
checkConnectionPause
);
loga
->
add
(
sender
->
getLog
());
...
...
@@ -326,7 +326,7 @@ UNetExchange::UNetExchange(uniset::ObjectId objId, uniset::ObjectId shmId, const
unetinfo
<<
myname
<<
"(init): (node='"
<<
n
<<
"') add basic receiver "
<<
h
<<
":"
<<
p
<<
endl
;
auto
r
=
make_shared
<
UNetReceiver
>
(
h
,
p
,
shm
);
auto
r
=
make_shared
<
UNetReceiver
>
(
h
,
p
,
shm
,
false
,
prefix
);
loga
->
add
(
r
->
getLog
());
...
...
@@ -358,7 +358,7 @@ UNetExchange::UNetExchange(uniset::ObjectId objId, uniset::ObjectId shmId, const
unetinfo
<<
myname
<<
"(init): (node='"
<<
n
<<
"') add reserv receiver "
<<
h2
<<
":"
<<
p2
<<
endl
;
r2
=
make_shared
<
UNetReceiver
>
(
h2
,
p2
,
shm
);
r2
=
make_shared
<
UNetReceiver
>
(
h2
,
p2
,
shm
,
false
,
prefix
);
loga
->
add
(
r2
->
getLog
());
...
...
extensions/UNetUDP/UNetReceiver.cc
View file @
2abfbf40
...
...
@@ -40,7 +40,10 @@ bool UNetReceiver::PacketCompare::operator()(const UniSetUDP::UDPMessage& lhs,
}
*/
// ------------------------------------------------------------------------------------------
UNetReceiver
::
UNetReceiver
(
const
std
::
string
&
s_host
,
int
_port
,
const
std
::
shared_ptr
<
SMInterface
>&
smi
,
bool
nocheckConnection
)
:
UNetReceiver
::
UNetReceiver
(
const
std
::
string
&
s_host
,
int
_port
,
const
std
::
shared_ptr
<
SMInterface
>&
smi
,
bool
nocheckConnection
,
const
std
::
string
&
prefix
)
:
shm
(
smi
),
recvpause
(
10
),
updatepause
(
100
),
...
...
@@ -71,11 +74,14 @@ UNetReceiver::UNetReceiver(const std::string& s_host, int _port, const std::shar
addr
=
s_host
.
c_str
();
ostringstream
logname
;
logname
<<
prefix
<<
"-R-"
<<
s_host
<<
":"
<<
setw
(
4
)
<<
port
;
unetlog
=
make_shared
<
DebugStream
>
();
unetlog
->
setLogName
(
myname
);
unetlog
->
setLogName
(
logname
.
str
()
);
auto
conf
=
uniset_conf
();
conf
->
initLogStream
(
unetlog
,
myname
);
conf
->
initLogStream
(
unetlog
,
prefix
+
"-log"
);
upThread
=
unisetstd
::
make_unique
<
ThreadCreator
<
UNetReceiver
>
>
(
this
,
&
UNetReceiver
::
updateThread
);
...
...
extensions/UNetUDP/UNetReceiver.h
View file @
2abfbf40
...
...
@@ -101,7 +101,9 @@ namespace uniset
public
std
::
enable_shared_from_this
<
UNetReceiver
>
{
public
:
UNetReceiver
(
const
std
::
string
&
host
,
int
port
,
const
std
::
shared_ptr
<
SMInterface
>&
smi
,
bool
nocheckConnection
=
false
);
UNetReceiver
(
const
std
::
string
&
host
,
int
port
,
const
std
::
shared_ptr
<
SMInterface
>&
smi
,
bool
nocheckConnection
=
false
,
const
std
::
string
&
prefix
=
"unet"
);
virtual
~
UNetReceiver
();
void
start
();
...
...
extensions/UNetUDP/UNetSender.cc
View file @
2abfbf40
...
...
@@ -31,10 +31,12 @@ namespace uniset
// -----------------------------------------------------------------------------
UNetSender
::
UNetSender
(
const
std
::
string
&
_host
,
const
int
_port
,
const
std
::
shared_ptr
<
SMInterface
>&
smi
,
bool
nocheckConnection
,
const
std
::
string
&
s_f
,
const
std
::
string
&
s_val
,
const
std
::
string
&
s_prefix
,
size_t
maxDCount
,
size_t
maxACount
)
:
const
std
::
string
&
s_prefix
,
const
std
::
string
&
prefix
,
size_t
maxDCount
,
size_t
maxACount
)
:
s_field
(
s_f
),
s_fvalue
(
s_val
),
prefix
(
s_prefix
),
pr
op_pr
efix
(
s_prefix
),
shm
(
smi
),
port
(
_port
),
s_host
(
_host
),
...
...
@@ -55,11 +57,14 @@ namespace uniset
myname
=
s
.
str
();
}
ostringstream
logname
;
logname
<<
prefix
<<
"-S-"
<<
s_host
<<
"-"
<<
port
;
unetlog
=
make_shared
<
DebugStream
>
();
unetlog
->
setLogName
(
myname
);
unetlog
->
setLogName
(
logname
.
str
()
);
auto
conf
=
uniset_conf
();
conf
->
initLogStream
(
unetlog
,
myname
);
conf
->
initLogStream
(
unetlog
,
prefix
+
"-log"
);
unetinfo
<<
myname
<<
"(init): read filter-field='"
<<
s_field
<<
"' filter-value='"
<<
s_fvalue
<<
"'"
<<
endl
;
...
...
@@ -407,7 +412,7 @@ namespace uniset
return
false
;
}
int
priority
=
it
.
getPIntProp
(
prefix
+
"_sendfactor"
,
0
);
int
priority
=
it
.
getPIntProp
(
pr
op_pr
efix
+
"_sendfactor"
,
0
);
auto
&
pk
=
mypacks
[
priority
];
...
...
extensions/UNetUDP/UNetSender.h
View file @
2abfbf40
...
...
@@ -69,9 +69,14 @@ namespace uniset
class
UNetSender
{
public
:
UNetSender
(
const
std
::
string
&
host
,
const
int
port
,
const
std
::
shared_ptr
<
SMInterface
>&
smi
,
bool
nocheckConnection
=
false
,
const
std
::
string
&
s_field
=
""
,
const
std
::
string
&
s_fvalue
=
""
,
const
std
::
string
&
prefix
=
"unet"
,
size_t
maxDCount
=
UniSetUDP
::
MaxDCount
,
size_t
maxACount
=
UniSetUDP
::
MaxACount
);
UNetSender
(
const
std
::
string
&
host
,
const
int
port
,
const
std
::
shared_ptr
<
SMInterface
>&
smi
,
bool
nocheckConnection
=
false
,
const
std
::
string
&
s_field
=
""
,
const
std
::
string
&
s_fvalue
=
""
,
const
std
::
string
&
prop_prefix
=
"unet"
,
const
std
::
string
&
prefix
=
"unet"
,
size_t
maxDCount
=
UniSetUDP
::
MaxDCount
,
size_t
maxACount
=
UniSetUDP
::
MaxACount
);
virtual
~
UNetSender
();
...
...
@@ -175,7 +180,7 @@ namespace uniset
std
::
string
s_field
=
{
""
};
std
::
string
s_fvalue
=
{
""
};
std
::
string
prefix
=
{
""
};
std
::
string
pr
op_pr
efix
=
{
""
};
const
std
::
shared_ptr
<
SMInterface
>
shm
;
std
::
shared_ptr
<
DebugStream
>
unetlog
;
...
...
extensions/UNetUDP/start_fg.sh
View file @
2abfbf40
...
...
@@ -3,6 +3,6 @@
uniset2-start.sh
-f
./uniset2-unetexchange
--unet-name
UNetExchange
--unet-run-logserver
\
--confile
test.xml
--smemory-id
SharedMemory
\
--unet-filter-field
rs
--unet-filter-value
2
--unet-maxdifferense
40
--unet-sendpause
1000
\
--dlog-add-levels
info,crit,warn
--unet-log-add-levels
info,crit,warn,any
$*
--dlog-add-levels
info,crit,warn
--unet-log-add-levels
info,crit,warn,any
--unet-S-localhost-3000-add-levels
any
$*
#--unet-nodes-confnode specnet
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