hotspot/agent/src/os/win32/serverLists.cpp
author never
Mon, 04 May 2009 22:06:47 -0700
changeset 2744 57f0579fbe09
parent 1 489c9b5090e2
child 5547 f4b087cbb361
permissions -rw-r--r--
6837224: libsaproc.so on linux needs version of 6799141 Reviewed-by: kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
489c9b5090e2 Initial load
duke
parents:
diff changeset
     2
 * Copyright 2000-2003 Sun Microsystems, Inc.  All Rights Reserved.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    21
 * have any questions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
#include <assert.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
#include "serverLists.hpp"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
//----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
// Lists
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
CRITICAL_SECTION Lists::crit;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
void
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
Lists::init() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
  InitializeCriticalSection(&crit);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
void
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
Lists::lock() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
  EnterCriticalSection(&crit);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
void
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
Lists::unlock() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
  LeaveCriticalSection(&crit);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
//----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
// ListsLocker
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
ListsLocker::ListsLocker() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  Lists::lock();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
ListsLocker::~ListsLocker() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
  Lists::unlock();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
//----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
// ChildInfo
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
ChildInfo::ChildInfo(DWORD pid, HANDLE childProcessHandle,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
                     HANDLE writeToStdinHandle, HANDLE readFromStdoutHandle,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
                     HANDLE auxHandle1, HANDLE auxHandle2) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  this->pid = pid;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  this->childProcessHandle = childProcessHandle;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  this->writeToStdinHandle = writeToStdinHandle;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  this->readFromStdoutHandle = readFromStdoutHandle;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
  this->auxHandle1 = auxHandle1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  this->auxHandle2 = auxHandle2;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  client = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
DWORD
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
ChildInfo::getPid() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  return pid;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
HANDLE
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
ChildInfo::getChildProcessHandle() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  return childProcessHandle;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
HANDLE
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
ChildInfo::getWriteToStdinHandle() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  return writeToStdinHandle;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
HANDLE
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
ChildInfo::getReadFromStdoutHandle() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
  return readFromStdoutHandle;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
void
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
ChildInfo::setClient(ClientInfo* clientInfo) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  client = clientInfo;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
ClientInfo*
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
ChildInfo::getClient() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
  return client;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
void
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
ChildInfo::closeAll() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
  CloseHandle(childProcessHandle);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  CloseHandle(writeToStdinHandle);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
  CloseHandle(readFromStdoutHandle);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
  CloseHandle(auxHandle1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
  CloseHandle(auxHandle2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
//----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
// ChildList
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
ChildList::ChildList() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
ChildList::~ChildList() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
void
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
ChildList::addChild(ChildInfo* info) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
  // Could store these in binary sorted order by pid for efficiency
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  childList.push_back(info);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
ChildInfo*
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
ChildList::removeChild(HANDLE childProcessHandle) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  for (ChildInfoList::iterator iter = childList.begin(); iter != childList.end();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
       iter++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
    ChildInfo* info = *iter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
    if (info->getChildProcessHandle() == childProcessHandle) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
      childList.erase(iter);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
      return info;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  assert(false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
  return NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
void
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
ChildList::removeChild(ChildInfo* info) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
  for (ChildInfoList::iterator iter = childList.begin(); iter != childList.end();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
       iter++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
    if (*iter == info) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
      childList.erase(iter);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
      return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
  assert(false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
ChildInfo*
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
ChildList::getChildByPid(DWORD pid) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
  for (ChildInfoList::iterator iter = childList.begin(); iter != childList.end();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
       iter++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
    ChildInfo* info = *iter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
    if (info->getPid() == pid) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
      return info;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
  return NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
int
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
ChildList::size() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
  return childList.size();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
ChildInfo*
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
ChildList::getChildByIndex(int index) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
  return childList[index];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
//----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
// ClientInfo
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
ClientInfo::ClientInfo(SOCKET dataSocket) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
  this->dataSocket = dataSocket;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
  buf = new IOBuf(32768, 131072);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
  buf->setSocket(dataSocket);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
  target = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
ClientInfo::~ClientInfo() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
  delete buf;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
SOCKET
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
ClientInfo::getDataSocket() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
  return dataSocket;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
IOBuf*
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
ClientInfo::getIOBuf() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
  return buf;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
void
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
ClientInfo::setTarget(ChildInfo* childInfo) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
  target = childInfo;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
ChildInfo*
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
ClientInfo::getTarget() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
  return target;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
void
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
ClientInfo::closeAll() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
  shutdown(dataSocket, SD_BOTH);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
  closesocket(dataSocket);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
  dataSocket = INVALID_SOCKET;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
//----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
// ClientList
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
ClientList::ClientList() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
ClientList::~ClientList() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
void
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
ClientList::addClient(ClientInfo* info) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
  clientList.push_back(info);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
bool
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
ClientList::isAnyDataSocketSet(fd_set* fds, ClientInfo** out) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
  for (ClientInfoList::iterator iter = clientList.begin(); iter != clientList.end();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
       iter++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
    ClientInfo* info = *iter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
    if (FD_ISSET(info->getDataSocket(), fds)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
      *out = info;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
      return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
  return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
void
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
ClientList::removeClient(ClientInfo* client) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
  for (ClientInfoList::iterator iter = clientList.begin(); iter != clientList.end();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
       iter++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
    if (*iter == client) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
      clientList.erase(iter);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
      return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
  assert(false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
int
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
ClientList::size() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
  return clientList.size();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
ClientInfo*
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
ClientList::get(int num) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
  return clientList[num];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
}