Changeset 7540 in orxonox.OLD for branches/network/src/lib/network/server_socket.h
- Timestamp:
- May 5, 2006, 3:16:09 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/server_socket.h
r7402 r7540 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 26 18 27 19 class ServerSocket : public BaseObject 28 20 { 29 21 public: 30 #warning old socket structure 31 ServerSocket(); 32 ServerSocket(unsigned int port); 22 ServerSocket( int port); 33 23 34 ServerSocket(ConnectionType connectionType);35 ServerSocket(ConnectionType connectionType, unsigned int port );36 24 virtual ~ServerSocket(); 37 25 38 bool listen( unsigned int port );39 NetworkSocket* getNewSocket( void );40 v oid close();41 inline bool isOk(){ return listenSocket!=NULL; }26 virtual bool listen( unsigned int port ) = 0; 27 virtual NetworkSocket* getNewSocket( void ) = 0; 28 virtual void close() = 0; 29 virtual bool isOk() { return this->bOk; }; 42 30 43 44 private: 45 void init(); 46 47 48 private: 49 #warning old socket structure 50 TCPsocket listenSocket; 51 52 ConnectionType connectionType; //!< the connection type of the socket {TCP,UDP} 53 TCPsocket listenSocketTCP; //!< tcp socket 54 UDPsocket listenSocketUDP; //!< udp socket 55 bool terminateThread; //!< true if thread terminated 56 57 bool _isListening; //!< true if listening 58 31 protected: 32 bool bOk; 59 33 60 34 };
Note: See TracChangeset
for help on using the changeset viewer.