HTML and CSS Reference
In-Depth Information
When the ElectroServer JavaScript API is updated to support Web-
Sockets, the port and protocol will likely be different.
There is a nifty admin tool for ElectroServer that allows you to view and modify all the
supported protocols and ports, as well as many other cool features of the socket server.
In the /admin directory of the install folder, you should find both an installer for an
Adobe AIR admin tool (named something like es5-airadmin-5.0.0.air ), and a /
webadmin directory with an HTML file named webadmin.html . Either one will work
for this exercise.
In order for the admin console to display properly, the server needs to
be started.
When you launch the admin tool, you will be asked to supply a username and password.
The default is administrator and password , unless you changed them upon installation.
Once you log in, click the Server Management button on the top menu, and then the
Gateways option from the side menu. You should see a screen that looks similar to
Figure 11-4 .
This screen shows you the port settings for each protocol that ElectroServer supports.
For the JavaScript API, we are most interested in the BinaryHTTP setting, which you
can see is set to port 8989.
The JavaScript API
Besides starting ElectroServer, you will also need the JavaScript API so you can begin
building Canvas apps that connect to the server. You should be able to find the Java-
Script API in the /apis/client/javascript directory of the folder in which you installed
ElectroServer (this name might change in the final version). The API should be named
ElectroServer-5-Client-JavaScript.js .
The Basic Architecture of a Socket-Server Application
Now that you have ElectroServer ready to go, and you have the JavaScript API, it is
time to learn a bit about how socket-server-based multiplayer/multiuser applications
are designed. Using a socket server means you are creating an application that relies on
a client for input from a user, as well as relying on a server to distribute that input to
other users who are connected to the first user.
A good example of this is a chat application. Most chat applications require a user to
enter a room (a logical space in which people are “chatting,” i.e., exchanging messages),
Search WWH ::




Custom Search