You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
end() has been called and the last message has been successfully sent
We do not throw an exception inside send() after:
end() has been called, but the last message has not been sent yet => should cause a watcher on a closed resource (Bad. May corrupt event loop as well or (typically) trigger an assertion failure: $written !== false).
fwrite() returns 0 while being the the first call to it within that onWritable loop. The promise is failed and the watcher cancelled. => Will trigger an InvalidWatcherError (this bug)
What is the expected behavior in the last two cases?
For the first case I think we can just throw \Error for trying to write to a self-end()ed stream.
For the latter case we should immediately return new Failure(new StreamException("Failed to write to socket: read watcher already closed due to previous write failure")) (not throw!).
I'm getting the following exception while having a look at amphp/socket#32:
server.php
client.php
The text was updated successfully, but these errors were encountered: