Skip to content

Commit

Permalink
Merge pull request #19 from savi-lang/update/latest-io
Browse files Browse the repository at this point in the history
Update for latest `IO` library changes.
  • Loading branch information
jemc authored Feb 16, 2023
2 parents 2d456a8 + d292413 commit 0bbf2af
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/TCP.Engine.savi
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,20 @@
// TODO: windows complete writes, flush-after-mute (pending writes logic from Pony)
// | IO.Action.Write |
// ...

| IO.Action.NotHandled |
// If the underlying engine didn't want to handle this event, it means
// this is likely a later connection attempt after we already had one.
// If we have more connection attempts pending, we'll unsubscribe it.
if (@_pending_connect_count > 0) (
@_pending_connect_count -= 1
_FFI.pony_asio_event_unsubscribe(event.id)
|
// If we have no more pending connection attempts, pass the buck to
// the caller to figure out what needs to be done with this event.
// Maybe they have another engine sharing the same IO actor, perhaps.
yield action
)
|
yield action
)
Expand Down

0 comments on commit 0bbf2af

Please sign in to comment.