[erlang-questions] Otp.NET: It would be nice to have seamless string support
Wed Apr 29 08:02:59 CEST 2009
I run into a problem while I tried to send Otp.Erlang.String
with length > 64k from a OTP.Net node to a native Erlang node.
The Erlang node only received a cut string, not the full one.
The cause of this trouble is the strong adherence of OTP.Net to the
external term format.
The Erlang node sends a list in an external term "STRING_EXT"
when the list length < 64k and all list entries are integers in the
But it sends a list as an external term "LIST_EXT" otherwise.
OTP.Net has implemented Otp.Erlang.String
but this is not a real Erlang type only an external term.
When I use OTP.Net to receive from or send strings to another node
I have to manually distinguish between these two cases.
Otp.Erlang.String S =
Payload = S.stringValue();
Otp.Erlang.List List =
Payload = stringValue(List);
private string stringValue(Otp.Erlang.List L)
System.Text.StringBuilder s = new
int _arity = L.Length;
for (int i = 0; i < _arity; i++)
E_Char = (Otp.Erlang.Long)L.elementAt(i);
Otp.Erlang.Object Message = new
Message = new Otp.Erlang.Int(L);
if (L < 65000)
Message = new Otp.Erlang.String(Payload);
Otp.Erlang.String Test = new
int LL = Test.stringValue().Length;
Message = toList(Payload);
Box.send(Other, new Tuple(Message));
This message is intended for a particular addressee only and
may contain business or company secrets. If you have received
this email in error, please contact the sender and delete the
message immediately. Any use of this email, including saving,
publishing, copying, replication or forwarding of the message
or the contents is not permitted.
More information about the erlang-questions