[erlang-questions] gen_tcp custom framing

Joern opendev@REDACTED
Fri Oct 12 12:00:47 CEST 2007


Hi Peter,

On 10/9/07, Peter Lund <erlang@REDACTED> wrote:

> 1> f(), <<Z,D:Z/binary,R/binary>> = <<2,3,4,5,6,7,8,9,0 >>, {Z,D,R}.
> {2,<<3,4>>,<<5,6,7,8,9,0>>}
>
> 2> f(), <<Z,D:Z+1/binary,R/binary>> = <<2,3,4,5,6,7,8,9,0 >>, {Z,D,R}.
> ** 1: syntax error before: '+' **
>
> I thought/hoped that 2 above would work, but when testing it, it did not.

IIRC I tried something along those lines using the bitlevel_binaries
compiler flag but to no avail.

> This forces you to do sequencial binary matching:

This is how I do it atm.

Best regards,


rgs/joern
--



More information about the erlang-questions mailing list