summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2017-02-10 23:01:33 +0100
committerEugen Wissner <belka@caraus.de>2017-02-10 23:01:33 +0100
commitc41fa2e98fdab61e4806869dc49576a105176eb8 (patch)
tree526b6e71a20c037a77546bc8bc38dabcdafdb8e8
parenta012ca40037566b223dbb9d40480d801282f449a (diff)
downloadtanya-c41fa2e98fdab61e4806869dc49576a105176eb8.tar.gz
Adjust kqueue build
-rw-r--r--source/tanya/async/event/kqueue.d10
-rw-r--r--source/tanya/async/event/selector.d8
2 files changed, 14 insertions, 4 deletions
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;
}
/**