ports, binaries & iovecs
Fri Oct 11 05:28:36 CEST 2002
I am finding that sending binaries to a port with port_command/2,
and receiving them with outputv(), doesn't work the way I had
expected. The problem is that I can't seem to control how the
ErlIOVec is created. I had expected, and hoped, that if I create
two seperate binaries in Erlang and send them with port_command/2
that my outputv() driver call back would receive them as seperate
SysIOVec structures. Instead I find that the emulator is making
up it's own mind:
1> port_command(Port, [<<0:32>>, <<0:32>>]).
ev->vsize = 2
ev->size = 8
2> port_command(Port, [<<0:128/integer-unit:8>>, <<0:32/integer-unit:8>>]).
ev->vsize = 3
ev->size = 160
Can anyone tell me what the rules are?
More information about the erlang-questions