diff --git a/source/tanya/async/event/kqueue.d b/source/tanya/async/event/kqueue.d index 721a792..8673ff7 100644 --- a/source/tanya/async/event/kqueue.d +++ b/source/tanya/async/event/kqueue.d @@ -241,10 +241,10 @@ final class KqueueLoop : SelectorLoop // If it is a ConnectionWatcher. Accept connections. if (transport is null) { - auto connection = cast(ConnectionWatcher) connections[events[i].data.fd]; + auto connection = cast(ConnectionWatcher) connections[events[i].ident]; assert(connection !is null); - acceptConnections(connections[events[i].ident]); + acceptConnections(connection); } else if (events[i].flags & EV_ERROR) { @@ -303,8 +303,12 @@ final class KqueueLoop : SelectorLoop * Params: * transport = Transport. * exception = Exception thrown on sending. + * + * Returns: $(D_KEYWORD true) if the operation could be successfully + * completed or scheduled, $(D_KEYWORD false) otherwise (the + * transport will be destroyed then). */ - protected override void feed(StreamTransport transport, + protected override bool feed(StreamTransport transport, SocketException exception = null) @nogc { if (!super.feed(transport, exception)) diff --git a/source/tanya/async/event/selector.d b/source/tanya/async/event/selector.d index 06662b5..67efd7f 100644 --- a/source/tanya/async/event/selector.d +++ b/source/tanya/async/event/selector.d @@ -149,8 +149,12 @@ abstract class SelectorLoop : Loop * Params: * transport = Transport. * exception = Exception thrown on sending. + * + * Returns: $(D_KEYWORD true) if the operation could be successfully + * completed or scheduled, $(D_KEYWORD false) otherwise (the + * transport will be destroyed then). */ - protected void feed(StreamTransport transport, + protected bool feed(StreamTransport transport, SocketException exception = null) @nogc in { @@ -184,7 +188,9 @@ abstract class SelectorLoop : Loop assert(watcher !is null); kill(watcher, exception); + return false; } + return true; } /**