c++,sockets,select,stdvector,berkeley-sockets
Your clientsV member should be a std::vector<base_socket*> (i.e. keeping the pointer references). You have a chance that a temporary client_t object is being created and destroyed during push_back if it needs to relocate existing elements to a different area (See Why does vector::push_back and emplace_back call value_type::constructor twice?). When this...
bind() expects a sockaddr* not a sockaddr_in*: bind(sfd, (struct sockaddr *) &my_addr, sizeof(my_addr)) Other than that, I don't see any other errors. Binding to port 0 is the correct way to bind to a random available port. If bind() and listen() do not report a failure then netstat should see...