Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

phServerThread.h

Go to the documentation of this file.
00001 /* ---------------------------------------------------------------------------
00002     Phission : 
00003         Realtime Vision Processing System
00004 
00005     Copyright (C) 2003 Philip D.S. Thoren (pthoren@cs.uml.edu)
00006     University of Massachusetts at Lowell,
00007     Laboratory for Artificial Intelligence and Robotics
00008 
00009     This file is part of Phission.
00010 
00011     Phission is free software; you can redistribute it and/or modify
00012     it under the terms of the GNU General Public License as published by
00013     the Free Software Foundation; either version 2 of the License, or
00014     (at your option) any later version.
00015 
00016     Phission is distributed in the hope that it will be useful,
00017     but WITHOUT ANY WARRANTY; without even the implied warranty of
00018     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019     GNU General Public License for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with Phission; if not, write to the Free Software
00023     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00024 
00025  ---------------------------------------------------------------------------*/
00026 /* -------------------------------------------------------------------------- *
00027  * phServerThread.h: Thread class to handle all the server's responsibilities *                                                                            *
00028  * --------------------------------------------------------------------------*/
00029 #ifndef PHSERVERTHREAD_H
00030 #define PHSERVERTHREAD_H
00031 
00032 #include <phission.h>
00033 /* -------------------------------------------------------------------------- */
00034 class phServerThread : public phThread
00035 {
00036 private:
00037     /* This is the port to set in the phServerSocket class for listening
00038      * for client connection requests */
00039     int m_port;
00040     /* The server object that implements the socket communications */
00041     phServerSocket m_server;
00042 
00043 public:
00044     phServerThread(int port = 0);
00045     virtual ~phServerThread();
00046 
00047     /* member variable access methods */
00048     int setPort(int port = 0);
00049     int getPort();
00050     
00051     /* run: where the server object is used to listen for requests and
00052      * spawn phClientHandlers to handle those requests */
00053     virtual int run();
00054     /* wakeup: tries to get the waiting server accepts to return and
00055      * also sets variables so that the thread can wakeup and finish */
00056     virtual int wakeup();
00057     /* cleanup: delete, reset any variables to allow reuse of this object */
00058     virtual int cleanup();
00059     /* error: this doesn't do much, it's here if anything needs to be
00060      * done if the thread has an error condition starting up */
00061     virtual int error();
00062 };
00063 
00064 
00065 #endif /* PHSERVERTHREAD_H */




Copyright (C) 2002 - 2007 Philip D.S. Thoren ( pthoren@users.sourceforge.net )
University Of Massachusetts at Lowell
Robotics Lab
SourceForge.net Logo

Generated on Sat Jun 16 02:44:05 2007 for phission by  doxygen 1.4.4