<br><br>Hello<br><br>I have the following functions that work perfectly in R14B04:<br><br>recv_frame_ssl(S, N, SslRecvTimeout) -><br>%%      io:format("SslRecvTimeout = ~p~n", [SslRecvTimeout]),<br>        {ok, Header} = ssl:recv(S, 4, SslRecvTimeout),<br>        <<Length:32/big>> = Header,<br>        {ok, Data} = ssl:recv(S, Length - 4, SslRecvTimeout),<br><br>        <<Data1/binary>> = Data,<br>        <br>        {ok, binary_to_list(Data1)}.<br>        <br>send_frame_ssl(Sock, Data) -><br>        <br>        DataBin = unicode:characters_to_binary(Data),<br>        HeaderLen = erlang:size(DataBin) + 4,<br>        <br>%%      error_logger:info_msg("SEND-FRAME:[~p]:~n:~p:~n:~p:~n:~p~n:~p~n", [self(), Data, DataBin, HeaderLen, <<HeaderLen:32/big>>]),<br>        <br>        ssl:send(Sock, <<HeaderLen:32/big>>),<br>        ssl:send(Sock, <<DataBin/binary>>).<br><br><br>However in R16 the code fails with:{error, socket_closed_remotely} .<br><br>This is because the server correctly receives and decodes the packet from the client, in recv_ssl_frame/3,<br><br>but when the server must send response to the client, in function send_frame_ssl/2 , the packet is no more correctly assembled <br>and the client closes the connection because does not receives the header which is the total length of the packet and hence does not know the length of data to be read from the socket<br>and hence the error on the server side {error, socket_closed_remotely} .<br><br>In R14B* this is working as expected, however in R15 and R16 does not.<br><br>What am I missing, what should I do in order to send to the client a correctly formatted  packet ?<br><br>Thank you in advanced,<br><br>Bogdan<br><br><br><br><br>