How to implement multiple sockets per client?

David Hopwood <>
Sat Aug 26 05:23:07 CEST 2006


Pupeno wrote:
> On Friday 25 August 2006 22:31, Jeff Crane wrote:
> 
>>I want to have a client connect to my barebones server
>>on 2 sockets. How are you supposed to ensure that a
>>second connection is from the same client?
> 
> You can check for the IP.

I think what was meant is a logical client. For example, it should be possible
to distinguish two logical connections (two pairs of TCP/IP connections) from
the same IP. This is necessary to handle clients connecting from behind a NAT,
at least.

If this is the requirement, have the client include the same random cookie in
both TCP connections, or, have one connection refer to the client IP *and* port
of the other.

-- 
David Hopwood <>





More information about the erlang-questions mailing list