Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ClientsTread
- {
- public:
- ClientsTread(){ _clients.clear(); }
- ~ClientsTread()
- {
- for(std::set<ClientSocket*>::iterator it = _clients.begin(); it != _clients.end(); it++)
- {
- if ((*it)->_socket)
- {
- shutdown((*it)->_socket, 2);
- close((*it)->_socket);
- }
- }
- }
- void add(ClientSocket *cs)
- {
- _clients.insert(cs);
- if (DEBUG)
- std::cout << "ClientsTread add:" << cs->_socket << std::endl;
- }
- private:
- std::set<ClientSocket*> _clients;
- } *_clientsthread;
Add Comment
Please, Sign In to add comment