I have an erlang client which is sending me data using gen_tcp:send/2
Specifically, it is sending me like this,
gen_tcp:send(Socket, <<A:16, B:16, Message/binary>>)
I have a c++ based, tcp server, that receives the message. If the client could have sent me using term_to_binary/1 I could have used ei_decode_X and decoded. Not sure How to receive this specific message and able to parse it. i.e, I should know the Message, values of A, B.
I receive this data using
recv(sock , client_message , 2000 , 0)
I can see that there is not data being received at all when I send like that. However, if I send it after term_to_binary/1 conversion, I am able to receive data.
Is it a proper way of sending data ?
Thanks