Hmm, I did, and that's why I'm asking this question :) It says:

"The Akka HTTP WebSocket API does not support half-closed connections which
means that if the either stream completes the entire connection is closed"

The problem I'm seeing is that it does NOT close the connection if only the
output completes.

Or did I misunderstand?

On Mon, Aug 1, 2016 at 11:34 AM, Konrad Malawski <
konrad.malaw...@lightbend.com> wrote:

> Please read the docs on this topic:
> http://doc.akka.io/docs/akka/2.4/scala/http/client-side/websocket-support.html#Half-Closed_WebSockets
>
> --
> Konrad `ktoso` Malawski
> Akka <http://akka.io> @ Lightbend <http://lightbend.com>
>
> On 1 August 2016 at 20:17:56, Aditya Prasad (akpra...@gmail.com) wrote:
>
> tl;dr: webSocketClientFlow does not close the websocket (or shut down its
> input stream) when the output stream ends, but I think it's supposed to. It
> *does* do the reverse (shut down the output when the input terminates).
>
> On Friday, July 29, 2016 at 6:28:14 PM UTC-7, Aditya Prasad wrote:
>>
>> Hi!
>>
>> I've got code like this:
>>
>>>     val flow = Http().webSocketClientFlow(WebSocketRequest(s"ws://...")))
>>>     val sink = Sink.actorRef(actor, EventsComplete)
>>>     Source.tick[Message](KeepAliveDelay, KeepAliveDelay,
>>> KeepAlive).via(flow).runWith(sink)
>>
>>
>> The Source.tick is there because if I use Source.empty, the websocket
>> connection gets closed immediately. The docs suggest using Source.maybe 
>> instead,
>> but then the websocket is still closed after some timeout. I need my client
>> to listen forever.
>>
>> Anyway: if actor finishes (e.g., server requests a hangup and it gets an
>> EventsComplete), the websocket does not close. The ticking keeps going,
>> sending stuff over the wire.
>>
>> This is strange because the docs say it doesn't support half-closed
>> websockets[1]. Any guesses what's going on, and what I should do about it?
>> In my actual code, one method generates the Source, and another piece of
>> code creates the Actor and runs with that Source.
>>
>> For now I've got a nasty (though fun to code!) workaround, with a custom
>> TerminationWatcherKillSwitch thing so that Flow.fromSinkAndSource will
>> terminate one stream if the other terminates.
>>
>> Thanks!
>>
>> [1]
>> http://doc.akka.io/docs/akka/2.4.8/scala/http/client-side/websocket-support.html
>>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to