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
213ff851
Commit
213ff851
authored
Oct 04, 2011
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(unet2): мелкие правки
parent
8346e452
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
UNetReceiver.cc
extensions/UNet2/UNetReceiver.cc
+5
-4
UNetReceiver.h
extensions/UNet2/UNetReceiver.h
+3
-2
No files found.
extensions/UNet2/UNetReceiver.cc
View file @
213ff851
...
...
@@ -7,6 +7,7 @@ using namespace std;
using
namespace
UniSetTypes
;
using
namespace
UniSetExtensions
;
// -----------------------------------------------------------------------------
/*
bool UNetReceiver::PacketCompare::operator()(const UniSetUDP::UDPMessage& lhs,
const UniSetUDP::UDPMessage& rhs) const
{
...
...
@@ -15,6 +16,7 @@ bool UNetReceiver::PacketCompare::operator()(const UniSetUDP::UDPMessage& lhs,
return lhs.num > rhs.num;
}
*/
// ------------------------------------------------------------------------------------------
UNetReceiver
::
UNetReceiver
(
const
std
::
string
s_host
,
const
ost
::
tpport_t
port
,
SMInterface
*
smi
)
:
shm
(
smi
),
...
...
@@ -72,7 +74,6 @@ a_cache_init_ok(false)
r_thr
=
new
ThreadCreator
<
UNetReceiver
>
(
this
,
&
UNetReceiver
::
receive
);
u_thr
=
new
ThreadCreator
<
UNetReceiver
>
(
this
,
&
UNetReceiver
::
update
);
ptRecvTimeout
.
setTiming
(
recvTimeout
);
}
// -----------------------------------------------------------------------------
...
...
@@ -186,8 +187,8 @@ void UNetReceiver::update()
void
UNetReceiver
::
real_update
()
{
UniSetUDP
::
UDPMessage
p
;
// обрабатываем
пока, очередь либо не опустеет
// либо обнаружится "дырка" в последовательности
// обрабатываем
, пока очередь либо не опустеет,
// либо обнаружится "дырка" в последовательности
,
// но при этом обрабатываем не больше maxProcessingCount
// за один раз..
int
k
=
maxProcessingCount
;
...
...
@@ -283,7 +284,7 @@ void UNetReceiver::real_update()
}
}
// Обрабока аналоговых
// Обрабо
т
ка аналоговых
for
(
size_t
i
=
0
;
i
<
p
.
acount
;
i
++
)
{
try
...
...
extensions/UNet2/UNetReceiver.h
View file @
213ff851
...
...
@@ -117,8 +117,9 @@ class UNetReceiver
struct
PacketCompare
:
public
std
::
binary_function
<
UniSetUDP
::
UDPMessage
,
UniSetUDP
::
UDPMessage
,
bool
>
{
bool
operator
()(
const
UniSetUDP
::
UDPMessage
&
lhs
,
const
UniSetUDP
::
UDPMessage
&
rhs
)
const
;
inline
bool
operator
()(
const
UniSetUDP
::
UDPMessage
&
lhs
,
const
UniSetUDP
::
UDPMessage
&
rhs
)
const
{
return
lhs
.
num
>
rhs
.
num
;
}
};
typedef
std
::
priority_queue
<
UniSetUDP
::
UDPMessage
,
std
::
vector
<
UniSetUDP
::
UDPMessage
>
,
PacketCompare
>
PacketQueue
;
PacketQueue
qpack
;
/*!< очередь принятых пакетов (отсортированных по возрастанию номера пакета) */
...
...
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