Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 25, 2006, 5:39:49 PM (18 years ago)
Author:
patrick
Message:

working on a dual connection server socket

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/udp_server_socket.h

    r9460 r9461  
    3333typedef std::vector<NetworkPacketList> PacketBuffer;
    3434
     35
     36//!< informations struct for each user
    3537struct UserInfo
    3638{
    37   IPaddress addr;
    38   byte randomByte;
     39  IPaddress     addr;            //!< ip address of this user
     40  byte          randomByte;      //!< random byte of this user
    3941};
     42
    4043
    4144typedef std::vector<UserInfo> UserList;
     
    4346typedef std::list<UdpSocket*> UdpSocketList;
    4447
     48
     49//!< the upd server socket listening for incoming connections
    4550class UdpServerSocket : public ServerSocket
    4651{
     
    4954    virtual ~UdpServerSocket();
    5055
     56    /* server socket manipulations */
    5157    virtual bool listen( unsigned int port );
    52 
    5358    virtual NetworkSocket* getNewClientSocket( void );
    5459    virtual NetworkSocket* getNewProxySocket( void );
     60    virtual void close();
    5561
    56     virtual void close();
    5762
    5863    virtual void update();
    5964
     65    /* network traffic interface */
     66    NetworkPacket getPacket( int userId );
     67    void removeUser( int userId );
     68    bool sendPacket( NetworkPacket networkPacket, int userId );
     69
     70
     71  private:
    6072    void removeUserPackets( int userId );
    61     void removeUser( int userId );
    62     NetworkPacket getPacket( int userId );
    63     bool sendPacket( NetworkPacket networkPacket, int userId );
    6473    int getPacketCount( int childId );
    6574    void initUser( int childId, IPaddress ip, byte randomByte );
    6675
     76
    6777  private:
    68     UDPsocket     socket;           //!< will be uses to send/recieve data
    69     UDPpacket *   packet;           //!< packet structure to recieve packet
    70     PacketBuffer  packetBuffer;     //!< will store recieved packets for UdpSockets
    71     UserList      userList;         //!< contains information about clients
    72     UdpSocketList newSocketList;    //!< contains new socket
     78    UDPsocket          socket;           //!< will be uses to send/recieve data
     79    UDPpacket *        packet;           //!< packet structure to recieve packet
     80    PacketBuffer       packetBuffer;     //!< will store recieved packets for UdpSockets
     81    UserList           userList;         //!< contains information about clients
     82    UdpSocketList      newSocketList;    //!< contains new socket
    7383
    7484};
Note: See TracChangeset for help on using the changeset viewer.