[erlang-questions] "Bad value on output port 'tcp_inet'" for null terminated messages
Thu Sep 10 20:20:44 CEST 2009
> ok = gen_tcp:send(Socket, "message text"),
> seems to work (the receiving end is of course confused), but
> ok = gen_tcp:send(Socket, "message text\0"),
> =ERROR REPORT==== 10-Sep-2009::20:21:21 ===
> Bad value on output port 'tcp_inet'
> How can I send the trailing 0-byte?
ok = gen_tcp:send(Socket, ["message text", 0]).
I haven't tested that this actually works (my erlang environment is missing after a update and with 2.5G data downloading one is taking quite lot of time) :)
"An I/O list is a binary or a (possibly deep) list of binaries or integers in the range 0..255."
Says Erlang Reference Manual about Port BIFs.
> This is erl5.7.2 on XP.
You're most welcomed,
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
More information about the erlang-questions