Changeset 10854


Ignore:
Timestamp:
May 27, 2011, 12:22:21 PM (8 years ago)
Author:
tbretz
Message:
Allow to use several ports on localhost for several fake boards for testing.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/EventBuilderWrapper.h

    r10852 r10854  
    9797        for (vector<string>::const_iterator it=addr.begin(); it!=addr.end(); it++)
    9898        {
    99             g_ip[i].port = 5000;
     99            //g_ip[i].port = 5000;
    100100            memset(g_ip[i].addr, 0, 100);
    101             strncpy(g_ip[i].addr, it->c_str(), 99);
     101            //strncpy(g_ip[i].addr, it->c_str(), 99);
     102
     103            size_t pos = it->find_first_of(':');
     104            if (pos==string::npos)
     105                continue;
     106
     107            string a = it->substr(0, pos);
     108            string p = it->substr(pos+1);
    102109
    103110            strcpy(g_ip[i].addr, "127.0.0.1");
     111            g_ip[i].port = atoi(p.c_str());
     112
    104113            i++;
    105114        }
Note: See TracChangeset for help on using the changeset viewer.