elixir-socket icon indicating copy to clipboard operation
elixir-socket copied to clipboard

How should I receive fragmented data

Open vincar opened this issue 8 years ago • 1 comments

Hi!I am a fresher on elixir.How should I receive fragmented data through by websocket? { :fragmented, :text, data } -> recv(socket) { :fragmented, :continuation, data } -> recv(socket) { :fragmented, :end, data } -> recv(socket)

I want to get total data in the end.

vincar avatar Jul 06 '17 10:07 vincar

Hi, I don't think this is really the right place for this question, since it's up to you (the application writer) to define your :continuation and :end mechanisms.

I think the solution would be to write an intermediary function, that calls itself passing back the data until it hits :end, and then once you hit the end it bubbles up the end result

nichochar avatar Jul 23 '17 17:07 nichochar