QJCC homepage

Package biz.chitec.qdemo.chat.server

GChat - a small GJSA server application.

See:
          Description

Class Summary
ChatLoginExecutor The login executor for the GChat server.
DoChatExecutor The chatting executor itself.
QJChatServer A demonstrational GJSA server implementing a chat server.
 

Package biz.chitec.qdemo.chat.server Description

GChat - a small GJSA server application.

Package Specification

This package contains the GChat server application. Explore the files in the following order: All source files do have extensive Javadoc documentation and lots of additional comments in the source code itself.

Running the server

Ensure that the appropriate path for the chitec-gjt sources is in your CLASSPATH. You should then be able to compile the demo, e.g. by using the cj compilation script (or by issuing javac or jikes to the .../org/gjt/chitec/demo/gchat directory. After that, you have the GChat server ready.

Start the server with

java org.gjt.chitec.demo.gchat.server.QJChatServer

When it comes up for the first time, it will need some seconds to compute an RSA key pair. When it prints "*** NOW READY TO ACCEPT CONNECTIONS ***", have two telnet windows at your hands.

Connect through "

telnet localhost 51000
". Issue the command

CHATLOGIN "anyname"
in exactly that spelling and with the quotation marks ("). Look how the server logs all of your commands. Now, you can send messages to the chat server which will propagate them to all connected clients. As there is only one client connected, use the second terminal window to connect with another telnet as other user. Note that you have to use a different name with the CHATLOGIN command from the second telnet as the server does not allow two chatters with the same name.

Now you can see how your messages appear on both clients when you type them in...

Extending the server

Now, let's suppose you want to add a new command. Say, a command that gives you the last ten messages sent through the system. These would be the steps:

Author:
chitec/Dirk Hillbrecht 2001
See Also:
org.gjt.chitec.demo.gchat.util, org.gjt.chitec.demo.gchat.client

QJCC homepage