Building a server to manage high concurrent connections is non-trival task. For those developers that use ActionScript 3 to build games on the client side it means having a totally different skillset. Being able to use ActionScript 3 on the server to build MMO’s or port client code to the server allows developers to leverage their skills on the server.
By walking through a live game example with more then 15,000 concurrent connections running on a medium Amazon EC2 server the presentation will:
1. Introduce Linux server configuration for high concurrent connected usage.
2. Introduce Socket class based on libev library for high concurrent connection.
3. Introduce leveraging Tamarin project for ActionScript 3 on the server.
14. 服务器 ActionScript 代码
function loopHandler():void
{
if (!ss.listening)
ss.listen("10.111.33.190", 12122);
else
serverBrain.beat(); // Game Tick
}
var serverDispatcher:SocketServerNerveDispatcher
= new SocketServerNerveDispatcher();
var serverBrain:ServerBrain = new ServerBrain();
var serverNerve:ServerNerveSystem
= new ServerNerveSystem(serverBrain, serverDispatcher);
serverBrain.addNerve(serverNerve);
var ss:ServerSocket
= serverDispatcher.createServerSocket(serverNerve);
ss.loop.add(loopHandler);
ss.start(250);
14
Fúwùqì shàng de ActionScript Flash Player Jiěpōu Core: Xūnǐ jī, Yuán yǔ, Jùfǎ APIs: C/C++ Shíxiàn fēngfù de Flash Player API hé gōngnéng de lèi Tamarin Kāi yuán de Flash Player de héxīn bùjiàn Méiyǒu fēngfù de API huò gōngnéng, nǐ bìxū zìjǐ biānxiě
Tamarin de jīchǔ gōngchéng -
Ànlì yánjiū
Xiànchǎng yǎnshì hé yuán dàimǎ
Fúwùqì shèzhì Yóuxì fúwùqì Amazon EC2 Medium fúwùqì 64 bit Ubuntu OS Yùn háng liǎng gè yóuxì shílì Zhǔyào de yóuxì Fùzǎi cèshì yóuxì Fùzǎi cèshì fúwùqì Amazon EC2 Medium fúwùqì Zì dìngyì cèshì jiǎoběn