Changeset 9461 in orxonox.OLD for branches/proxy/src/lib/network/udp_server_socket.h
- Timestamp:
- Jul 25, 2006, 5:39:49 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/udp_server_socket.h
r9460 r9461 33 33 typedef std::vector<NetworkPacketList> PacketBuffer; 34 34 35 36 //!< informations struct for each user 35 37 struct UserInfo 36 38 { 37 IPaddress addr;38 byte randomByte;39 IPaddress addr; //!< ip address of this user 40 byte randomByte; //!< random byte of this user 39 41 }; 42 40 43 41 44 typedef std::vector<UserInfo> UserList; … … 43 46 typedef std::list<UdpSocket*> UdpSocketList; 44 47 48 49 //!< the upd server socket listening for incoming connections 45 50 class UdpServerSocket : public ServerSocket 46 51 { … … 49 54 virtual ~UdpServerSocket(); 50 55 56 /* server socket manipulations */ 51 57 virtual bool listen( unsigned int port ); 52 53 58 virtual NetworkSocket* getNewClientSocket( void ); 54 59 virtual NetworkSocket* getNewProxySocket( void ); 60 virtual void close(); 55 61 56 virtual void close();57 62 58 63 virtual void update(); 59 64 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: 60 72 void removeUserPackets( int userId ); 61 void removeUser( int userId );62 NetworkPacket getPacket( int userId );63 bool sendPacket( NetworkPacket networkPacket, int userId );64 73 int getPacketCount( int childId ); 65 74 void initUser( int childId, IPaddress ip, byte randomByte ); 66 75 76 67 77 private: 68 UDPsocket socket; //!< will be uses to send/recieve data69 UDPpacket * packet; //!< packet structure to recieve packet70 PacketBuffer packetBuffer; //!< will store recieved packets for UdpSockets71 UserList userList; //!< contains information about clients72 UdpSocketList newSocketList; //!< contains new socket78 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 73 83 74 84 };
Note: See TracChangeset
for help on using the changeset viewer.