-
Website
http://20bits.com -
Original page
http://20bits.com/articles/erlang-a-generalized-tcp-server/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
Felix Purnama
3 comments · 1 points
-
hadley
2 comments · 1 points
-
adamheroku
2 comments · 3 points
-
twiss
2 comments · 1 points
-
maxima128
2 comments · 1 points
-
-
Popular Threads
I'm using geshi with an Erlang syntax plugin I wrote myself.
compiling echo_server.erl twice in a row kills the server.
This is really frustrating to someone coming from lisp where
hot code updates trully "just work" and things do not fail
mysteriously. I have been trying to find out the cause of
this behavior for the past hour with no success.
and processes that run old code are purged (killed). This is badly
explained almost everywhere i've looked and examples are scarce to come
by for something so important. So my next question then is how to
do a hot code update without killing the tcp server or dropping any existing
connections. After all this is erlang where 99.999% availability can be achieved
this trivial task (which you get for free in common lisp without having to do
anything special) should be possible.
After hours of scavenging in badly written documentation, trying to understand
the monstrosity that seems to be OTP (also noticed that pragmatic programming: erlang
conveniently pushes this issue under the rug) i still have found no solutions.
It seems everywhere i look at these days, proponents of erlang keep rambling about
"scalability, availability, hot code updates" as if these are things that can be
magically gotten for free. Well if "hot code updates" is how things are done in erlang,
i will have none of that.
:)
I would also be interested in some informations about asynchronous accept. In fact I use "receive" and messages between processes to handle recv() on the socket. I do this because my process must have the ability to recv() and send() datas without knowing which one will come first. So it could be good for me to extend this style of managing things to accept() as well.
It uses a non-blocking accept although undocumented.
Try it out.
I'm *very* new to erlang, so may not be following correctly, but it looks like a process is spawned for every "accept", so a malicious user could cause some trouble if the spawned process was actually doing something more intensive?.
Thanks for the erlang posts, do keep them up if you can.
Given the constant need for something like gen_tcp, why on earth haven't they added one to the official Erlang/OTP bundle?
you solution is super great!
in socket_server:start() how does "loop" get mapped in the socket_server code?
I mean where does the "loop" function that gets passed in actually get called?
But the gen_server behavior has a lot to offer, especially if you want to make your server more robust.
It helps me a lot.
helped me a lot