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
93881190
Commit
93881190
authored
Jan 26, 2015
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(LogServer): переделал механизм посылки сообщение о лимите подключений.
Теперь посылается сообщение и соединение закрывается.
parent
4830c243
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
LogServer.cc
src/Log/LogServer.cc
+0
-2
LogSession.cc
src/Log/LogSession.cc
+16
-3
No files found.
src/Log/LogServer.cc
View file @
93881190
...
@@ -167,8 +167,6 @@ void LogServer::work()
...
@@ -167,8 +167,6 @@ void LogServer::work()
}
}
}
}
cerr
<<
"*** LOG SERVER THREAD STOPPED.."
<<
endl
;
{
{
// uniset_rwmutex_wrlock l(mutSList);
// uniset_rwmutex_wrlock l(mutSList);
for
(
auto
&
i
:
slist
)
for
(
auto
&
i
:
slist
)
...
...
src/Log/LogSession.cc
View file @
93881190
...
@@ -288,7 +288,7 @@ void NullLogSession::run()
...
@@ -288,7 +288,7 @@ void NullLogSession::run()
{
{
while
(
!
cancelled
)
while
(
!
cancelled
)
{
{
{
{
// lock slist
uniset_rwmutex_wrlock
l
(
smutex
);
uniset_rwmutex_wrlock
l
(
smutex
);
for
(
auto
i
=
slist
.
begin
();
!
cancelled
&&
i
!=
slist
.
end
();
++
i
)
for
(
auto
i
=
slist
.
begin
();
!
cancelled
&&
i
!=
slist
.
end
();
++
i
)
{
{
...
@@ -308,14 +308,27 @@ void NullLogSession::run()
...
@@ -308,14 +308,27 @@ void NullLogSession::run()
{
{
(
*
s
.
get
())
<<
msg
<<
endl
;
(
*
s
.
get
())
<<
msg
<<
endl
;
s
->
sync
();
s
->
sync
();
s
->
disconnect
();
// послали сообщение и закрываем соединение..
}
}
}
}
}
slist
.
clear
();
}
// unlock slist
if
(
cancelled
)
if
(
cancelled
)
break
;
break
;
msleep
(
5000
);
msleep
(
5000
);
// делаем паузу, чтобы освободить на время "список"..
}
{
uniset_rwmutex_wrlock
l
(
smutex
);
for
(
auto
i
=
slist
.
begin
();
i
!=
slist
.
end
();
++
i
)
{
auto
s
(
*
i
);
if
(
s
)
s
->
disconnect
();
}
}
}
}
}
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
...
...
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