How to implement multiple sockets per client?
Sat Aug 26 19:20:44 CEST 2006
> -------- Original Message --------
> From: Jeff Crane <>
> Apparently from:
> Subject: How to implement multiple sockets per client?
> Date: Fri, 25 Aug 2006 15:31:25 -0700 (PDT)
>>Is there a way to spawn 2 sockets from an accept?
>>Do I have to listen then initiate to do this
> You basically do the accept. This gives you 1 socket. Then in
> the next line you initiate a gen_tcp:connect back to your client.
> This gives you your 2nd socket. In effect you make your client a
> server as well.
This interacts quite badly with firewalls, which will usually block the
You did mention this, but I think you understated the problem -- remember
that "personal" firewalls on each machine also need to be considered, and
no single network admin has control over these, even if the protocol were
only to be used in a single network.
David Hopwood <>
More information about the erlang-questions