Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9291 in orxonox.OLD


Ignore:
Timestamp:
Jul 14, 2006, 12:25:17 PM (18 years ago)
Author:
patrick
Message:

network socket and addresses passins

Location:
branches/proxy/src/lib/network
Files:
3 edited

Legend:

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

    r7954 r9291  
    2727     */
    2828    virtual void connectToServer( std::string host, int port ) = 0;
    29    
     29
    3030    /**
    3131     * disconnect from server
     
    4040     */
    4141    virtual bool writePacket(byte * data, int length) = 0;
    42    
     42
    4343    /**
    4444     * read a packet sent by another NetworkSocket
     
    5454     */
    5555    inline bool isOk() { return this->bOk; }
    56  
     56
     57    /** @returns the ip adderess of the destination socket */
     58    IPaddress getDestAddress() { return ip; }
     59
     60
    5761  protected:
    58     bool bOk;            //!< check for socket status
     62    bool              bOk;            //!< check for socket status
    5963
     64    IPaddress         ip;             //!< host,port
    6065};
    6166
  • branches/proxy/src/lib/network/network_stream.cc

    r9290 r9291  
    463463
    464464              it->second.nodeType = it->second.handshake->getRemoteNodeType();
     465              it->second.ip = it->second.socket->getDestAddress();
    465466              this->networkMonitor->addNode(&it->second);
    466467
  • branches/proxy/src/lib/network/udp_socket.h

    r9290 r9291  
    3838    virtual int readPacket(byte * data, int maxLength);
    3939
    40     IPaddress getAddress() { return this->ip; }
    41 
    4240
    4341  private:
    4442    UdpServerSocket * serverSocket;   //!< will get packets here
    4543    int               userId;         //!< user id used by serverSocket
    46     IPaddress         ip;             //!< host,port
    4744    UDPsocket         socket;         //!< socket used to send/recieve
    4845    UDPpacket *       packet;
Note: See TracChangeset for help on using the changeset viewer.