官术网_书友最值得收藏!

Running examples

The easiest way to run the examples is to browse the examples through the embedded web server.

  1. Start the SmartFoxServer if it is not running.
  2. Browse to http://localhost:8080 in the web browser.
  3. It will load the default page of the embedded web server with SmartFoxServer logo.
  4. Click the Install Examples if this is the first time while running the examples.
  5. Click the Browse Examples after the installed examples.
  6. A list of examples appear and you click on them to have some ideas on what SmartFoxServer can basically do.

Loading a simple chat application

Let's test the Simple Chat in Tutorials (AS 3.0) category.

After loading the simple chat, a progress bar appears with the text connecting to server. If the example failed to connect the server, it will freeze at that screen. If it is connected to the server, a login box appears and asks for the login name.

If you failed to see the login box, there is something wrong. It may be a wrong setting in the configuration file, it may be some other issue that failed to start up the SmartFoxServer, or it may be some issue between the testing browser and the server, for example, firewall port blocking.

As we are testing a multiuser application, we can actually launch many instances of the chat applications to test the real-time chatting.

  1. Open several new browsers.
  2. Type in the same address of the chat application in the new browsers. The default URL is http://localhost:8080/Examples/AS3/SmartFoxChat/bin/.
  3. Log in to the chat application with different names for different browsers.
  4. Test the application by sending messages in different browsers. The messages will all appear (almost) at the same time in all browsers.

Let's take a look on how the messages are sent between different chat application clients.

  1. One of the users types in "Hi" in the chat application.
  2. The user clicks the Send button to send the "Hi" message.
  3. The message is sent from the chat application to SmartFoxServer.
  4. SmartFoxServer decodes the message and broadcasts this messages to all connected clients in the same room.
  5. All clients who receive the "Hi" message display it on the chat application.

To further understand what SmartFoxServer can do, we may not only test the simple chat example but also test other examples that are provided by SmartFoxServer.

主站蜘蛛池模板: 邓州市| 莆田市| 柳林县| 伊金霍洛旗| 海南省| 措美县| 麻江县| 石家庄市| 全椒县| 潜山县| 泉州市| 池州市| 广昌县| 仙桃市| 海阳市| 吐鲁番市| 绥德县| 娱乐| 临沭县| 裕民县| 宁晋县| 敦化市| 昌平区| 扬中市| 青州市| 高雄市| 柳州市| 咸丰县| 北海市| 莆田市| 西林县| 星座| 勐海县| 泸溪县| 同心县| 平乐县| 六安市| 哈密市| 南部县| 海淀区| 常德市|