Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 17, 2006, 10:15:33 AM (18 years ago)
Author:
patrick
Message:

work from this weekend in the train :D

  • the ip should now synchronize over network in the handshake (always the favorite 2 proxy server ips)
  • the network monitor now keeps track of all network nodes answers with proxy server lists if asked/needed
  • it is untested :D
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/monitor/network_monitor.cc

    r9292 r9300  
    1919#include "debug.h"
    2020
     21#include "proxy/proxy_settings.h"
     22
    2123#include "network_monitor.h"
    2224#include "network_node.h"
     25#include "peer_info.h"
    2326#include "network_stream.h"
     27#include "netdefs.h"
     28
     29#include <vector>
    2430
    2531
     
    4551
    4652  this->setSynchronized(false);
     53
     54  // assuming that the config files are already read we get the proxy servers
     55  std::vector<IPaddress*>* proxyList = &ProxySettings::getInstance()->getProxyList();
     56  std::vector<IPaddress*>::iterator it = proxyList->begin();
     57  // create a peer info class and a network node class for each new proxy and add them to the passive list
     58  for(; it < proxyList->end(); it++)
     59  {
     60    PeerInfo* peer = new PeerInfo();
     61    peer->ip = *(*it);
     62    peer->nodeType = NET_PROXY_SERVER;
     63    peer->userId = -1;
     64
     65    NetworkNode* node = new NetworkNode(peer);
     66    this->addPassiveProxyServer( this->localNode, peer);
     67  }
    4768}
    4869
     
    86107}
    87108
     109/**
     110 * tihs adds the new network node
     111 * @param ip ip of the new node
     112 */
     113void NetworkMonitor::addNode(IPaddress ip)
     114{}
     115
    88116
    89117/**
     
    128156  else if( pInfo->isMasterServer())
    129157    node->addMasterServer(pInfo);
     158}
     159
     160
     161/**
     162 * @returns the proxy server of the first choice
     163 */
     164PeerInfo* NetworkMonitor::getFirstChoiceProxy()
     165{
     166  // return the fist proxy in the list
     167  return this->localNode->getActiveProxyServer(0);
     168}
     169
     170
     171/**
     172 * @returns the proxy server of second choice
     173 */
     174PeerInfo* NetworkMonitor::getSecondChoiceProxy()
     175{
     176  // return the second server in the list
     177  return this->localNode->getActiveProxyServer(1);
    130178}
    131179
     
    185233  }
    186234
     235  // check if a proxy server has to activated
     236
    187237  this->debug();
    188238}
Note: See TracChangeset for help on using the changeset viewer.