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
3897860d
Commit
3897860d
authored
Sep 05, 2016
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(UNet): убрал лишнее неиспользуемое поле iotype,
небольшие правки в инициализации
parent
6141adc3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
15 deletions
+11
-15
UNetExchange.h
extensions/UNetUDP/UNetExchange.h
+4
-4
UNetReceiver.cc
extensions/UNetUDP/UNetReceiver.cc
+1
-4
UNetReceiver.h
extensions/UNetUDP/UNetReceiver.h
+6
-7
No files found.
extensions/UNetUDP/UNetExchange.h
View file @
3897860d
...
...
@@ -175,12 +175,12 @@ class UNetExchange:
private
:
UNetExchange
();
timeout_t
initPause
;
timeout_t
initPause
=
{
0
}
;
UniSetTypes
::
uniset_rwmutex
mutex_start
;
PassiveTimer
ptHeartBeat
;
UniSetTypes
::
ObjectId
sidHeartBeat
=
{
UniSetTypes
::
DefaultObjectId
};
timeout_t
maxHeartBeat
=
10
;
timeout_t
maxHeartBeat
=
{
10
}
;
IOController
::
IOStateList
::
iterator
itHeartBeat
;
UniSetTypes
::
ObjectId
test_id
=
{
UniSetTypes
::
DefaultObjectId
};
...
...
@@ -238,7 +238,7 @@ class UNetExchange:
// ( реализацию см. ReceiverInfo::step() )
UniSetTypes
::
ObjectId
sidRespond
;
IOController
::
IOStateList
::
iterator
itRespond
;
bool
respondInvert
;
bool
respondInvert
=
{
false
}
;
UniSetTypes
::
ObjectId
sidLostPackets
;
IOController
::
IOStateList
::
iterator
itLostPackets
;
UniSetTypes
::
ObjectId
sidChannelNum
;
...
...
@@ -248,7 +248,7 @@ class UNetExchange:
typedef
std
::
deque
<
ReceiverInfo
>
ReceiverList
;
ReceiverList
recvlist
;
bool
no_sender
;
/*!< флаг отключения посылки сообщений (создания потока для посылки)*/
bool
no_sender
=
{
false
}
;
/*!< флаг отключения посылки сообщений (создания потока для посылки)*/
std
::
shared_ptr
<
UNetSender
>
sender
;
std
::
shared_ptr
<
UNetSender
>
sender2
;
...
...
extensions/UNetUDP/UNetReceiver.cc
View file @
3897860d
...
...
@@ -172,7 +172,6 @@ bool UNetReceiver::createConnection( bool throwEx )
try
{
udp
=
make_shared
<
UDPReceiveU
>
(
addr
,
port
);
//udp = make_shared<UDPReceiveU>();
udp
->
setBlocking
(
false
);
// делаем неблокирующее чтение (нужно для libev)
evReceive
.
set
<
UNetReceiver
,
&
UNetReceiver
::
callback
>
(
this
);
...
...
@@ -537,7 +536,7 @@ void UNetReceiver::readEvent( ev::io& watcher )
}
// только если "режим подготовки закончился, то можем генерировать "события"
if
(
ptPrepare
.
checkTime
()
&&
trTimeout
.
change
(
ptRecvTimeout
.
checkTime
()
)
)
if
(
ptPrepare
.
checkTime
()
&&
trTimeout
.
change
(
tout
)
)
{
auto
w
=
shared_from_this
();
...
...
@@ -795,7 +794,6 @@ void UNetReceiver::initDCache( UniSetUDP::UDPMessage& pack, bool force )
if
(
d
.
id
!=
pack
.
d_id
[
i
]
)
{
d
.
id
=
pack
.
d_id
[
i
];
d
.
iotype
=
conf
->
getIOType
(
d
.
id
);
shm
->
initIterator
(
d
.
ioit
);
}
}
...
...
@@ -840,7 +838,6 @@ void UNetReceiver::initACache( UniSetUDP::UDPMessage& pack, bool force )
if
(
d
.
id
!=
pack
.
a_dat
[
i
].
id
)
{
d
.
id
=
pack
.
a_dat
[
i
].
id
;
d
.
iotype
=
conf
->
getIOType
(
d
.
id
);
shm
->
initIterator
(
d
.
ioit
);
}
}
...
...
extensions/UNetUDP/UNetReceiver.h
View file @
3897860d
...
...
@@ -271,24 +271,23 @@ class UNetReceiver:
struct
CacheItem
{
long
id
;
long
id
=
{
UniSetTypes
::
DefaultObjectId
}
;
IOController
::
IOStateList
::
iterator
ioit
;
UniversalIO
::
IOType
iotype
;
CacheItem
()
:
id
(
UniSetTypes
::
DefaultObjectId
)
,
iotype
(
UniversalIO
::
UnknownIOType
)
{}
id
(
UniSetTypes
::
DefaultObjectId
)
{}
};
typedef
std
::
vector
<
CacheItem
>
CacheVec
;
struct
CacheInfo
{
CacheInfo
()
:
cache_init_ok
(
false
)
{
}
bool
cache_init_ok
;
cache_init_ok
(
false
){}
bool
cache_init_ok
=
{
false
};
CacheVec
cache
;
};
// ключом является UDPMessage::getDataID()
typedef
std
::
unordered_map
<
long
,
CacheInfo
>
CacheMap
;
CacheMap
d_icache_map
;
/*!< кэш итераторов для булевых */
...
...
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