| Line |  | 
|---|
| 1 | /*! | 
|---|
| 2 | * @file server_socket.h | 
|---|
| 3 | *  waits for incoming connections | 
|---|
| 4 |  | 
|---|
| 5 | */ | 
|---|
| 6 |  | 
|---|
| 7 | #ifndef _TCP_SERVER_SOCKET | 
|---|
| 8 | #define _TCP_SERVER_SOCKET | 
|---|
| 9 |  | 
|---|
| 10 | /* include this file, it contains some default definitions */ | 
|---|
| 11 | #include "netdefs.h" | 
|---|
| 12 |  | 
|---|
| 13 |  | 
|---|
| 14 | /* include base_object.h since all classes are derived from this one */ | 
|---|
| 15 | #include "base_object.h" | 
|---|
| 16 | #include "server_socket.h" | 
|---|
| 17 |  | 
|---|
| 18 |  | 
|---|
| 19 | class TcpServerSocket : public ServerSocket | 
|---|
| 20 | { | 
|---|
| 21 | ObjectListDeclaration(TcpServerSocket); | 
|---|
| 22 | public: | 
|---|
| 23 | TcpServerSocket( int port ); | 
|---|
| 24 |  | 
|---|
| 25 | virtual ~TcpServerSocket(); | 
|---|
| 26 |  | 
|---|
| 27 | virtual bool listen( unsigned int port ); | 
|---|
| 28 | virtual NetworkSocket* getNewSocket( void ); | 
|---|
| 29 | virtual void close(); | 
|---|
| 30 | virtual void update() {}; | 
|---|
| 31 |  | 
|---|
| 32 | private: | 
|---|
| 33 | TCPsocket listenSocket; | 
|---|
| 34 | bool terminateThread; | 
|---|
| 35 |  | 
|---|
| 36 | bool _isListening; | 
|---|
| 37 |  | 
|---|
| 38 | void init(); | 
|---|
| 39 |  | 
|---|
| 40 | }; | 
|---|
| 41 |  | 
|---|
| 42 | #endif | 
|---|
       
      
      Note: See 
TracBrowser
        for help on using the repository browser.