Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 14, 2007, 3:35:18 PM (18 years ago)
Author:
scheusso
Message:

blabla

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/network/dummyclient.cc

    r204 r208  
    55
    66#include <iostream>
     7#include <string>
    78#include <enet/enet.h>
    89#include "network/PacketManager.h"
     
    2021  atexit(enet_deinitialize);
    2122 
    22   enet_address_set_host(&address, "127.0.0.1");
     23  cout << "Enter address of the server xxx.xxx.xxx.xxx (enter for localhost)" << endl;
     24  string str;
     25  getline(cin, str);
     26  cout << "You entered: " << str << endl;
     27  if(str.compare("")==0)
     28    str="127.0.0.1";
     29 
     30  enet_address_set_host(&address, str.c_str());
    2331  address.port = 5555;
    2432
     
    3846        // wait 5 seconds for the connection attempt to succeed
    3947  if(enet_host_service(client, &event, 5000) > 0 && event.type == ENET_EVENT_TYPE_CONNECT){
    40     puts("Connection to localhost:5555 succeeded.");
     48    cout << "Connection to " << str << " succeeded." << endl;
     49    //puts("Connection to localhost:5555 succeeded.");
    4150  }else{
    4251    enet_peer_reset(peer);
    43     puts("Connection to localhost:5555 failed.");
     52    cout << "Connection to " << str << " failed." << endl;
     53    //puts("Connection to localhost:5555 failed.");
    4454  }
    4555
Note: See TracChangeset for help on using the changeset viewer.