Efficiently accepting TCP connections

Joe Armstrong (AL/EAB) <>
Fri May 13 09:26:57 CEST 2005



> -----Original Message-----
> From: 
> [mailto:]On Behalf Of Corrado Santoro
> Sent: den 12 maj 2005 16:22
> To: joel reymont
> Cc: 
> Subject: Re: Efficiently accepting TCP connections
> 
> 
> joel reymont wrote:
> > Is there an efficient idiom for handling gen_tcp 
> connections on the server side?


Yes I always use

http://www.sics.se/~joe/tutorials/web_server/tcp_server.erl

To see how it's used read

http://www.sics.se/~joe/tutorials/web_server/web_server.html

I have used this simple bit of code many many times for building web servers
rpc servers, telnet servers etc.

/Joe


> One possibility is to use thread pools. The "leader-follower" 
> object-oriented design pattern by Doug Schmidt et al. has 
> been proposed 
> for this purpose.
> 
> Ciao,
> --C.
> 
> -- 
> ======================================================
> Eng. Corrado Santoro, Ph.D.
> 
> University of Catania - Engineering Faculty
> Department of Computer Science and
> Telecommunications Engineering
> Viale A. Doria, 6 - 95125 CATANIA (ITALY)
> 
> Tel: +39 095 7382144 Int. (5) 8035
>       +39 095 7382380
>       +39 095 7382365
>       +39 095 7382364
> 
> VoIP: sip:
> 
> Fax: +39 095 7382397
> 
> EMail: 
> Personal Home Page:
>              http://www.diit.unict.it/users/csanto
> 
> NUXI Home Page:
>              http://nuxi.iit.unict.it
> ======================================================
> 
> 



More information about the erlang-questions mailing list