Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 28, 2005, 5:49:48 PM (18 years ago)
Author:
patrick
Message:

network: changed the synchronizeable interface, since the data synchronizeables, more debug output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/network_manager.cc

    r5798 r5804  
    7676  /* set the class id for the base object */
    7777  this->setClassID(CL_NETWORK_MANAGER, "NetworkManager");
    78  
     78
    7979  /* initialize the references */
    8080  this->netStreamList = NULL;
    8181  this->syncList = NULL;
    82  
     82
    8383  PRINTF(0)("NetworkManager created\n");
    8484}
     
    128128NetworkStream& NetworkManager::establishConnection(IPaddress& address, Synchronizeable& sync)
    129129{
    130   PRINTF(0)("Establish connection...\n");
     130  printf("Establish connection to server %s, on port %u\n", SDLNet_ResolveIP(&address), address.port);
    131131  /* creating a new network stream, it will register itself automaticaly to the class list */
    132132  NetworkStream* netStream = new NetworkStream(address, sync, NET_CLIENT);
     
    137137 * @param sync: the listener
    138138 */
    139 NetworkStream& NetworkManager::createServer(Synchronizeable& sync, int port)
     139NetworkStream& NetworkManager::createServer(Synchronizeable& sync, unsigned int port)
    140140{
    141   PRINTF(0)("Create a new server socket...\n");
     141  printf("Create a new server socket, liestening on port %u...\n", port);
    142142  /* creating a new network stream, it will register itself automaticaly to the class list */
    143143  NetworkStream* netStream = new NetworkStream(sync, port, NET_SERVER);
     
    160160void NetworkManager::synchronize()
    161161{
    162   PRINTF(0)("NetworkManager synchronizes\n");
    163162  if (this->netStreamList != NULL || (this->netStreamList = ClassList::getList(CL_NETWORK_STREAM)) != NULL)
    164163  {
     
    167166    while( stream)
    168167    {
    169       printf("NetworkManager::synchronize ");
    170       if(stream->isServer()) printf("Server\n"); else printf("Client\n");
    171168      stream->processData();
    172169      stream = (NetworkStream*)(iterator->nextElement());
Note: See TracChangeset for help on using the changeset viewer.