Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5804 in orxonox.OLD for branches/network/src/subprojects


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

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

Location:
branches/network/src/subprojects/network
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/subprojects/network/network_unit_test.cc

    r5800 r5804  
    3636  SDL_Delay(20);
    3737
    38   NetworkSocket client(ip, 9999);
     38  NetworkSocket client(ip);
    3939
    4040  char buf[1024];
     
    123123  printf("=================\n");
    124124
    125   IPaddress ip;
    126   //SDLNet_ResolveHost(&ip, "127.0.0.1", 9999);
    127   SDLNet_ResolveHost(&ip, "localhost", 9999);
    128   Synchronizeable* clientSync = new SimpleSync();
    129   Synchronizeable* serverSync = new SimpleSync();
     125  Synchronizeable* clientSync = new SimpleSync("Client\0");
     126  Synchronizeable* serverSync = new SimpleSync("Server\0");
    130127
    131 
     128  unsigned int port = 9999;
    132129
    133130  /* create the network manager */
     
    138135
    139136  /* create a server stream */
    140   nm->createServer(*serverSync, 9999);
     137  nm->createServer(*serverSync, port);
    141138
    142139  /* esatblish a connection */
     140  IPaddress ip;
     141  int error = SDLNet_ResolveHost(&ip, "127.0.0.1", port);
     142  //SDLNet_ResolveHost(&ip, "localhost", port);
     143  if(error == -1) printf("\n\nerror on address resolution, program inconsistancy\n\n");
    143144  nm->establishConnection(ip, *clientSync);
    144145
  • branches/network/src/subprojects/network/simple_sync.cc

    r5802 r5804  
    2828 *  default constructor
    2929 */
    30 SimpleSync::SimpleSync()
    31   : Synchronizeable()
     30SimpleSync::SimpleSync(const char* name)
     31  : Synchronizeable(name)
    3232{
    3333  this->outLength = 10;
  • branches/network/src/subprojects/network/simple_sync.h

    r5800 r5804  
    1313{
    1414  public:
    15     SimpleSync();
     15    SimpleSync(const char* name);
    1616    ~SimpleSync();
    1717
    1818    virtual void writeBytes(byte* data, int length);
    1919    virtual int readBytes(byte* data);
     20
    2021
    2122  private:
Note: See TracChangeset for help on using the changeset viewer.