forked from trygve-isaacson/code-vault
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvserver.cpp
More file actions
31 lines (26 loc) · 856 Bytes
/
vserver.cpp
File metadata and controls
31 lines (26 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
Copyright c1997-2014 Trygve Isaacson. All rights reserved.
This file is part of the Code Vault version 4.1
http://www.bombaydigital.com/
License: MIT. See LICENSE.md in the Vault top level directory.
*/
#include "vserver.h"
#include "vmutexlocker.h"
VServer::VServer()
: mSessions()
, mSessionsMutex("VServer::mSessionsMutex")
{
}
void VServer::addClientSession(VClientSessionPtr session) {
VMutexLocker locker(&mSessionsMutex, "VServer::addClientSession()");
mSessions.push_back(session);
}
void VServer::removeClientSession(VClientSessionPtr session) {
VMutexLocker locker(&mSessionsMutex, "VServer::removeClientSession()");
for (VClientSessionList::iterator i = mSessions.begin(); i != mSessions.end(); i++) {
if ((*i) == session) {
(void) mSessions.erase(i);
break;
}
}
}