[erlang-questions] How to save Socket data in ETS

Hynek Vychodil vychodil.hynek@REDACTED
Wed Mar 29 08:09:01 CEST 2017


Hi,
Do not type it in Erlang shell but use variable bound to
Port. #Port<0.11255> is a way how Erlang visualize Port value but it is not
a Port value. You can't make Port from "#Port<0.11255>" which is what
Erlang shell received from your keyboard. You have to use what Erlang shell
received from (erlang:)open_port/2 and then transformed to "#Port<0.11255>"
and sent to IO server which shows it to the terminal. You have to bound it
to the variable or use v(N) pseudofunction.
Hynek Vychodil

On Wed, Mar 29, 2017 at 7:28 AM Dmitry <mbike2000ru@REDACTED> wrote:

> Hello,
>
> What is correct way to save tcp socket data in ETS?
>
> I tried this way:
>
> ets:insert(socket, {"79514484992",#Port<0.11255>}), But it gives "syntax
> error".
>
> When I place commas around - everything is ok:
>
> ets:insert(socket, {"79514484992",'#Port<0.11255>'}) - this is ok, but how
> to add commas around Port?
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170329/ba8ca8c8/attachment.htm>


More information about the erlang-questions mailing list