Skip to content

Instantly share code, notes, and snippets.

@SammyJames
Created December 31, 2014 02:33
Show Gist options
  • Save SammyJames/957bc56219d7fd5056f1 to your computer and use it in GitHub Desktop.
Save SammyJames/957bc56219d7fd5056f1 to your computer and use it in GitHub Desktop.
for ( auto it = ConnectedSockets.cbegin(); it != ConnectedSockets.cend(); ++it )
{
if ( send( it->second, buffer, wrapper.ByteSize() + 4, 0 ) < 0 )
{
fprintf( stderr, "Failed to send packet to '%s' (error = %s)\n", it->first.c_str(),
strerror( errno ) );
it = ConnectedSockets.erase( it );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment