Changeset 7954 in orxonox.OLD for trunk/src/lib/network/server_socket.h
- Timestamp:
- May 29, 2006, 3:28:41 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/network/server_socket.h
r6981 r7954 8 8 #define _SERVER_SOCKET 9 9 10 #ifdef HAVE_SDL_H11 #include <SDL_thread.h>12 #else13 #include <SDL/SDL_thread.h>14 #endif15 10 /* include this file, it contains some default definitions */ 16 11 #include "netdefs.h" … … 21 16 #include "network_socket.h" 22 17 23 //sleep when waiting for connections24 #define _MSECONDS_SLEEP_LISTEN 10025 18 26 19 class ServerSocket : public BaseObject 27 20 { 28 private: 29 TCPsocket listenSocket; 30 bool terminateThread; 21 public: 22 ServerSocket( int port); 31 23 32 bool _isListening;24 virtual ~ServerSocket(); 33 25 34 void init(); 26 virtual bool listen( unsigned int port ) = 0; 27 virtual NetworkSocket* getNewSocket( void ) = 0; 28 virtual void close() = 0; 29 virtual void update() = 0; 30 virtual bool isOk() { return this->bOk; }; 35 31 36 public: 37 ServerSocket(); 38 ServerSocket( unsigned int port ); 39 virtual ~ServerSocket(); 40 bool listen( unsigned int port ); 41 NetworkSocket* getNewSocket( void ); 42 void close(); 43 inline bool isOk(){ return listenSocket!=NULL; } 32 protected: 33 bool bOk; 34 44 35 }; 45 36
Note: See TracChangeset
for help on using the changeset viewer.