Move all IOWatcher members to the transports

This commit is contained in:
2017-02-11 19:47:57 +01:00
parent c41fa2e98f
commit 3454a1965a
4 changed files with 164 additions and 105 deletions

View File

@ -196,7 +196,7 @@ abstract class Loop
* Params:
* watcher = Watcher.
*/
void start(SocketWatcher watcher) @nogc
void start(ConnectionWatcher watcher) @nogc
{
if (watcher.active)
{
@ -266,26 +266,6 @@ abstract class Loop
blockTime_ = blockTime;
}
/**
* Kills the watcher and closes the connection.
*
* Params:
* watcher = Watcher.
* exception = Occurred exception.
*/
protected void kill(IOWatcher watcher, SocketException exception = null) @nogc
in
{
assert(watcher !is null);
}
body
{
watcher.socket.shutdown();
defaultAllocator.dispose(watcher.socket);
watcher.exception = exception;
pendings.enqueue(watcher);
}
/**
* Does the actual polling.
*/