Noux/net: add reset_all() method to sd registry

This method is called when a child is exiting to remove all remaining
sockets from the socket descriptor registry to close all sockets.
This commit is contained in:
Josef Söntgen 2012-06-21 16:40:18 +02:00 committed by Norman Feske
parent 57b0490fc6
commit 2010a74fba
1 changed files with 6 additions and 0 deletions

View File

@ -56,6 +56,12 @@ namespace Noux {
_reset_sd(i);
}
void reset_all()
{
for (unsigned i = 0; i < MAX_SOCKET_DESCRIPTORS; i++)
_reset_sd(i);
}
int add_io_channel(Shared_pointer<T> io_channel, int sd = -1)
{
if (sd == -1) {