Changeset 10862


Ignore:
Timestamp:
May 27, 2011, 1:36:37 PM (8 years ago)
Author:
tbretz
Message:
Added the possibility to fake more than just one board.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/fad.cc

    r10853 r10862  
    381381    void start_accept()
    382382    {
    383         cout << "Start accept..." << flush;
     383        cout << "Start accept " << acc0.local_endpoint().port() << "..." << flush;
    384384        tcp_connection::shared_ptr new_connection = tcp_connection::create(/*acceptor_.*/acc0.io_service());
    385385
     
    427427        ba::io_service io_service;
    428428
    429         int port = argc==2 ? lexical_cast<int>(argv[1]) : 5000;
    430 
    431         tcp_server server(io_service, port);
     429        int port = argc>=2 ? lexical_cast<int>(argv[1]) : 5000;
     430        int n    = argc==3 ? lexical_cast<int>(argv[2]) :    1;
     431
     432        vector<shared_ptr<tcp_server>> servers;
     433
     434        for (int i=0; i<n; i++)
     435        {
     436            shared_ptr<tcp_server> server(new tcp_server(io_service, port));
     437            servers.push_back(server);
     438
     439            port += 8;
     440        }
    432441
    433442        //  ba::add_service(io_service, &server);
Note: See TracChangeset for help on using the changeset viewer.