#include "clientControlThread.h"#include <pthread.h>#include <unistd.h>#include "../common/intToChar.h"#include "../common/buffer.h"#include "../common/generic.h"#include "frontEnd.h"#include "network.h"#include "clientThread.h"Go to the source code of this file.
Functions | |
| void* | ClientControlThread ( void* argz ) |
| The Client Control Thread. More... | |
Variables | |
| Network* | network |
| map<int,Buffer*> | clientBufferIn |
| The buffers the matrixThread's clients (those are coreThread and outputThread) read from. More... | |
|
The Client Control Thread.
| args | The arguments passed by main() |
Definition at line 47 of file clientControlThread.cpp.
00048 {
00049 // CCTArgs* args = (CCTArgs*) argz;
00050
00051 extern FrontEnd* frontEnd;
00052
00053 int clientSock;
00054
00055 frontEnd->displayDebugMessage ("ClientControlThread started");
00056 frontEnd->displayUsers (0);
00057 frontEnd->displayMatrices (0);
00058
00059 network = new Network ();
00060
00061 string msg;
00062 pthread_t* cThread;
00063
00064 while (1)
00065 {
00066 clientSock = network->waitForConnection ();
00067
00068 msg = "Connection established on socket ";
00069 msg += intToChar (clientSock);
00070 frontEnd->displayDebugMessage (msg.c_str ());
00071 // frontEnd->displayUsers (clientsConnected);
00072
00073 cThread = new pthread_t;
00074
00075 if ( clientBufferIn[clientSock] )
00076 delete clientBufferIn[clientSock];
00077 clientBufferIn[clientSock] = new Buffer ();
00078
00079 if (pthread_create (cThread, NULL, ClientThread, &clientSock) != 0)
00080 {
00081 frontEnd->displayDebugMessage ("Error: can't create client thread !");
00082 }
00083
00084
00085 }
00086 return argz;
00087 }
|
The buffers the matrixThread's clients (those are coreThread and outputThread) read from.
Definition at line 45 of file clientControlThread.cpp.
|
Definition at line 29 of file clientControlThread.cpp.
1.1.2 written by Dimitri van Heesch,
© 1997-2000