Skip to content

Commit 0bbf2af

Browse files
authored
Merge pull request #19 from savi-lang/update/latest-io
Update for latest `IO` library changes.
2 parents 2d456a8 + d292413 commit 0bbf2af

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/TCP.Engine.savi

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,20 @@
9393
// TODO: windows complete writes, flush-after-mute (pending writes logic from Pony)
9494
// | IO.Action.Write |
9595
// ...
96+
97+
| IO.Action.NotHandled |
98+
// If the underlying engine didn't want to handle this event, it means
99+
// this is likely a later connection attempt after we already had one.
100+
// If we have more connection attempts pending, we'll unsubscribe it.
101+
if (@_pending_connect_count > 0) (
102+
@_pending_connect_count -= 1
103+
_FFI.pony_asio_event_unsubscribe(event.id)
104+
|
105+
// If we have no more pending connection attempts, pass the buck to
106+
// the caller to figure out what needs to be done with this event.
107+
// Maybe they have another engine sharing the same IO actor, perhaps.
108+
yield action
109+
)
96110
|
97111
yield action
98112
)

0 commit comments

Comments
 (0)