Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't silently drop data when trying to send on a closed connection #6

Open
SeanTAllen opened this issue Feb 6, 2019 · 1 comment

Comments

@SeanTAllen
Copy link
Member

Currently send on a TCPConnectionActor looks like:

  fun ref send(data: ByteSeq) =>
    if self().state is Open then
      try
        PonyTCP.send(self().event, data, data.size())?
    end

If the connection is closed, or there is otherwise an error, that is silently eaten. Ideally what is needed here is some sort of return that allows a caller to know if there was success or not. Then, you could write a behavior like:

be send(sender: SuccessCallbackHaver, data: ByteSeq) =>
  if not send(data) then
    sender.failure()
  end

to indicate the lack of success.

SeanTAllen added a commit that referenced this issue Feb 16, 2019
@SeanTAllen
Copy link
Member Author

send is now a function in TCPConnection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant