I was wondering if ASP.NET is more efficent than PHP with sockets. Ive frozen a server several times doing relatively few connections on PHP. I was wondering if any server side programming engines are capable of hosting a reliable and efficient socket server.
Having never implemented a socket server in PHP, nor ever touching ASP.NET I can't comment on those.
I've seen many great socket applications implemented in Python. I recommend looking into Twisted.
I've personally played around with EventMachine (Ruby), and it's definitely a great little library to use. Their goal is:
Extremely high scalability, performance and stability for the most demanding production environments
Creating a server with EventMachine is as simple as:
require 'rubygems'
require 'eventmachine'
module Echo
def receive_data data
send_data data
end
end
EM.run {
EM.start_server "0.0.0.0", 10000, Echo
}
You should be able to benchmark this pretty easily. It's a simple echo server.
A word of caution with php: AFAIK threading is not enabled by default and so getting this run efficiently will be one extra step for you. No idea about ASP.NET on this.
I'm currently in the middle of doing the exact same thing and had a couple thousand lines of php sockets code written before deciding to move over to c++.