Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 5, 2006, 3:16:09 PM (19 years ago)
Author:
rennerc
Message:

implemented udp sockets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/server_socket.h

    r7402 r7540  
    88#define _SERVER_SOCKET
    99
    10 #ifdef HAVE_SDL_H
    11 #include <SDL_thread.h>
    12 #else
    13 #include <SDL/SDL_thread.h>
    14 #endif
    1510/* include this file, it contains some default definitions */
    1611#include "netdefs.h"
     
    2116#include "network_socket.h"
    2217
    23 //sleep when waiting for connections
    24 #define _MSECONDS_SLEEP_LISTEN 100
    25 
    2618
    2719class ServerSocket : public BaseObject
    2820{
    2921  public:
    30 #warning old socket structure
    31     ServerSocket();
    32     ServerSocket(unsigned int port);
     22    ServerSocket( int port);
    3323
    34     ServerSocket(ConnectionType connectionType);
    35     ServerSocket(ConnectionType connectionType, unsigned int port );
    3624    virtual ~ServerSocket();
    3725
    38     bool listen( unsigned int port );
    39     NetworkSocket* getNewSocket( void );
    40     void 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; };
    4230
    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;
    5933
    6034};
Note: See TracChangeset for help on using the changeset viewer.