I want to store tuples regarding information on other network participants in an ETS table.
I would like to use a tuple of {ip_address(), port_number()} (return of inet:peername(Socket) as the key of the entries. Aka I want to use the combination of address / port as an identifier for the other nodes / entries in the ETS table.
Is this possible with ets? Or do I have to use an other type as a key?
ets:insert(Table, {{"127.0.0.1", 4000}, value}).? That seems to be working fine. - Dogbertets:insert(Table, {{{0,0,0,0,0,0,0,1}, 4000}, value}).. It does seem to work fine for me, too. I however recently got some strange errors and could not find information on whether one could use tuples. I could imagine maybe erlang gets confused which of the nested tuples it should regard as key. - tnull