Optimum programming language to implement server using tcp/ip socket [closed]
What could be the optimum programming languages (Perl, PHP, Java, Python or something else) to implement server (multi-threaded?) using tcp/ip socket serving like 1000's of clients with the streaming data?
Using C/C++ with libevent, we were streaming 800mbps sustained to 30,000 active connections (two four core processors, 7 threads each running one event loop). Erlang is a reasonable choice too. It is far safer against programmer errors. But it cannot keep pace to event driven c/c++ ... been there and had to rewrite (hint, erlang is written in c).
Python with Twisted Framework
www.twistedmatrix.com
Java with XSocket or Apache Mina Frameworks (which Red5 Flash/video streaming media sever based on)
mina.apache.org
xsocket.sourceforge.net
They all are multithreaded , easy and very powerful.
Erlang of course :-) But then again, your requirements are not clear ;-)
It was designed from ground up to handle multi-threaded networking applications. It's origin comes from Ericsson: they use Erlang in (some of) their networking products.
This doesn't precisely answer this question, but it will help answer future questions. The problem of connecting thousands of clients to the same server is known as the c10k problem. There you will find lots of answers and helpful information about setting up that kind of server.
based on the sparse information given I would say either c or erlang
What language are you most familiar with? What kind problem set do you have? A lot depends on these questions. Most popular programming languages have good documentation for doing socket programmimng. It depends on tastes. I prefer the C programming language. I'm sure some people will also chime to offer Erlang as a good language to use. Again, it depends.
Apple already sells an optimum multi-threaded streaming media server.
http://www.apple.com/quicktime/streamingserver/
You might be able to buy it and save yourself a lot of work.
I can't tell from your question what you're trying to do, but buying a solution is usually optimal.
精彩评论