Fix epoll connection bugs

This commit is contained in:
2016-11-30 21:53:30 +01:00
parent 192ee20bf7
commit ed0eb4ac74
6 changed files with 21 additions and 23 deletions

View File

@ -107,7 +107,7 @@ class EpollLoop : SelectorLoop
{
if (errno != EINTR)
{
throw defaultAllocator.make!BadLoopException();
throw theAllocator.make!BadLoopException();
}
return;
}

View File

@ -101,7 +101,7 @@ class IOCPLoop : Loop
completionPort = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 0);
if (!completionPort)
{
throw defaultAllocator.make!BadLoopException("Creating completion port failed");
throw theAllocator.make!BadLoopException("Creating completion port failed");
}
}
@ -141,7 +141,7 @@ class IOCPLoop : Loop
catch (SocketException e)
{
MmapPool.instance.dispose(overlapped);
defaultAllocator.dispose(e);
theAllocator.dispose(e);
return false;
}
}
@ -173,7 +173,7 @@ class IOCPLoop : Loop
catch (SocketException e)
{
MmapPool.instance.dispose(overlapped);
defaultAllocator.dispose(e);
theAllocator.dispose(e);
return false;
}
}

View File

@ -127,13 +127,13 @@ else version (DragonFlyBSD)
version (MacBSD):
import dlib.async.event.selector;
import dlib.async.loop;
import dlib.async.transport;
import dlib.async.watcher;
import dlib.memory;
import dlib.memory.mmappool;
import dlib.network.socket;
import tanya.async.event.selector;
import tanya.async.loop;
import tanya.async.transport;
import tanya.async.watcher;
import tanya.memory;
import tanya.memory.mmappool;
import tanya.network.socket;
import core.stdc.errno;
import core.sys.posix.unistd;
import core.sys.posix.sys.time;
@ -250,7 +250,7 @@ class KqueueLoop : SelectorLoop
{
if (errno != EINTR)
{
throw defaultAllocator.make!BadLoopException();
throw theAllocator.make!BadLoopException();
}
return;
}

View File

@ -224,7 +224,7 @@ abstract class SelectorLoop : Loop
}
catch (SocketException e)
{
defaultAllocator.dispose(e);
theAllocator.dispose(e);
break;
}
if (client is null)
@ -235,7 +235,7 @@ abstract class SelectorLoop : Loop
IOWatcher io;
auto transport = MmapPool.instance.make!SelectorStreamTransport(this, client);
if (connections.length >= client.handle)
if (connections.length > client.handle)
{
io = cast(IOWatcher) connections[client.handle];
}