Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 
Anchor
C++
C++
C++

Code Block
themeEmacs
languagecpp
titleMain Function
int main(int argc, const char *argv[])
{   
    // need an ip
    if (argc != 2) {
        // report error
        std::cerr << "usage: " << argv[0] << " <ip>" << std::endl;
        
        // done
        return -1;
    } else {
        // create connection
        MyConnection connection(argv[1]);

        // start the main event loop
        Event::MainLoop::instance()->run();

        // done
        return 0;
    }
}

...