Open buster84 opened 7 years ago
@buster84 I wonder if using Flow.fromSinkAndSourceCoupled
instead of Flow.fromSinkAndSource
would have produced the desired behavior for your example? If so, perhaps we should call that out in the documentation in a couple of places and perhaps include an example? If not, then I agree with you and @jrudolph that it would probably make sense to make it possible to switch this behavior from configuration, and starting by introducing the switch and then considering swapping the default.
@raboof Thanks!! I didn't know that flow. The flow works as we expect. I agree with mentioning about this in the documentation. Also we should provide public api which use Flow.fromSinkAndSourceCoupled
. Currently we only provide handleMessagesWithSinkSource
which use Flow.fromSinkAndSource
.
https://github.com/akka/akka-http/blob/v10.1.0-RC2/akka-http-core/src/main/scala/akka/http/scaladsl/model/ws/UpgradeToWebSocket.scala#L41-L55
@buster84 that sounds reasonable, would you be interested in PR'ing that?
@raboof Thank you for the response. I will send PR for adding new api which use Flow.fromSinkAndSourceCoupled
but not for documentation because I am not native English speaker so I think someone not me is suitable to write the document.
None of us are native english speakers ;-) Please give it a try and we'll help out! :-) Thanks in advance
Okay, thanks. I will try to write the document in this weekend.
Hi, I found a problem that WebSocket server never send back WebSocket Close Connection when server output is infinite. Some WS libraries can't close connection because of this problem(At least SocketRocket and jetfire can't close connection).
I checked InfinitOutputServer.scala never send back Close connection and InfinitOutputServer.js do send back close connection using wireshark.
InfinitOutputServer.scala result is:
And InfinitOutputServer.js result is:
rfc6455 says:
I guess current behavior breaks RFC because of
the endpoint MUST send a Close frame in response.
.Problematic code is here