How can I make an UDP packet in Erlang?
The backbone of packets:
byte 0-3: SAMP
byte 4: 127
byte 5: 0
byte 6: 0
byte 7: 1
byte 8: first byte of ‘7777’
byte 9: second byte of ‘7777’
byte 10: ‘i’
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.
assuming
SAMPis a variable and'i'is the character “i”.Look at Bit Syntax Expressions for the syntax of binaries and Bit Syntax Examples for more examples. The second one has an example of writing an IP packet in one bit syntax expression/pattern, which is very neat.