2

I am building an Erlang server-client program. The server is written in Erlang OTP and the client in Java with Jinterface.

When creating a Jinterface connection I have to set a node name in the constructor OtpNode(). The problem is that this is done before connecting to the server (obviously), but each client must have unique names. If a client tries to connect to the server when a client with the same name is already connected, then the new connection fails.

How do I solve this? My first taught was to have a node without name or let the server supply the client with a name, but that does not seems to work...

rablentain
  • 6,641
  • 13
  • 50
  • 91

1 Answers1

0

Sounds like a job for UUID.randomUUID().

"UUID" stands for "Universally Unique ID", and it allows you to assume that any two clients will generate a different UUID without needing to contact each other.

Nathaniel Waisbrot
  • 23,261
  • 7
  • 71
  • 99