tags:

views:

174

answers:

8

Hi,

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?

Thanks Vishal

A: 

based on the sparse information given I would say either c or erlang

ennuikiller
+1  A: 

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.

jldupont
Just based on other answers, is Erlang the answer to everything?
BobbyShaftoe
@BobbyShaftoe: I am not sure I understand your question. One thing is certain: "there is no such thing as a silver bullet"
jldupont
+1  A: 

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.

Greg Hewgill
+1. It's a good article.
BobbyShaftoe
A: 

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.

BobbyShaftoe
+2  A: 

This is a poor question. You have to analyse your: 1) requirements 2) abilities 3) time and other factors. There is no good answer saying "you have to do it in (...)".

kubal5003
A: 

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.

S.Lott
Isn't this a Quicktime streaming media server?
BobbyShaftoe
A: 

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.

V3ss0n
+1  A: 

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).

tex