this my code to receive data
-module(t).
-compile(export_all).
start() ->
{ok, LSock} = gen_tcp:listen(5555, [binary, {packet, 0},
{active, false}]),
{ok, Sock} = gen_tcp:accept(LSock),
{ok, Bin} = do_recv(Sock, []),
ok = gen_tcp:close(Sock),
Bin.
do_recv(Sock, Bs) ->
io:format("(="), io:format(Bs),io:format("=)~n"),
case gen_tcp:recv(Sock, 0) of
{ok, B} ->
do_recv(Sock, [Bs, B]);
{error, closed} ->
{ok, list_to_binary(Bs)}
end.
i send to socket in series - 1, then 2, then 3, then 4, then 5
code is accumulates received data
it's print to screen
(=12345=)
how to modify the code to the code printed
(=1=)
(=2=)
(=3=)
(=4=)
(=5=)
that data is not accumulated