Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "server.h"
- #include "client.h"
- #include <iostream>
- #include <exception>
- int main()
- {
- Server *s = new Server;
- s->setAcceptConnections(true);
- s->start();
- while (s->hasAccept()) {
- for (ClientsMap::const_iterator it = s->begin(); it != s->end(); ++it) {
- try
- {
- printf("%s\n", it->second->receive().c_str());
- }
- catch(std::exception const & e)
- {
- std::cout << "Exception: " << e.what() << std::endl;
- system("pause");
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement