I need to convert pid to binary in Erlang, and send it to another pid. But i need the size of the binary data to be 1 byte. Is it posible?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t do this. One byte can only represent 256 different values, and there are more than 256 possible process IDs. The PID encodes both the node identification and the implementation-dependent process numer; Can someone explain the structure of a Pid in Erlang? has more details. You need to arrange for your protocol to allow for more than one byte to be sent or stored.