Author: Ron K. Cytron
and David Jurgens
| || 25 ||Mar
|| 26 ||Mar
|| 2 ||Apr
|| 2 ||Apr
Protocols allow programs running on different computers to interoperate
and communicate with each other. In this lab, you will initiate a session
with the AIM server and respond to
incoming messages using the KWIC object from Lab 2.
You continue in this lab with the team you have formed from
By the end of this lab, you should
- Understand a simple protocol (
- Understand how an AIM session operates.
- Appreciate (even more) the value of team programming.
Signing on to the
Be sure to open a socket to
new Socket("toc.oscar.aol.com", 9898)
The following is the minimum you need to do to sign onto the
Many variations are possible. For example, after you sign on the server
will send you a
| Client sends || Server sends |
| FLAPON\r\n\r\n || |
| || Signon Frame (partial) |
| Signon Frame (complete) || |
| Data Frame with toc_signon || |
| || SIGN_ON |
| || CONFIG |
| toc_add_buddy somebuddy || |
| toc_init_done || |
CONFIG message that tells you the groups
and buddies in buddy list.
You could wait until
you get the
CONFIG message to do any
toc_add_buddy commands, and then you could add the buddies
you want to watch. Just make sure you add some buddy and do
toc_init_done within 30 seconds of signing on.
You could use the Visitor pattern to process the
message. A list of Visitors could process every incoming message,
CONFIG Visitor would be looking just for that message
and take appropriate action.
Format of the
As with all
TOC commands, you place the command in
DataFrame and send it to the server.
According to the specification,
the format of a
toc_signon command is as follows:
toc_signon authorizer-host authorizer-port User-Name Password language version
The components of the command are separated by a space.
- One member of the team should volunteer his or her signon name for
- The password is encrypted using a symmetric key system based on
Tic/Toc as described in the
specification. Your team should write
staticmethod to produce the encrypted string.
- must be
- You can be creative here, as this tells the server the name of the
client you are running.
What to do in Lab Section
- Work together on the code to encrypt passwords.
- Work together on the Client code to get it to sign on to the
toc.oscar.aol.com, port 9898.
- Figure out how you will detect an incoming message, find its
contents, and then submit it to a KWIC object to get a response.
You will have to send the response back to the sender.
- Ideas on how to come up with a good resopnse will be discussed
- Have one partner log onto AOL, using AIM Express if necessary, and send a message to your bot.
- Get some screen shots of the responses or pring the buffer for turning
- For some real fun, get your IM bot to send a message to somebody
else's IM bot, and watch the sparks fly.
What to turn in:
- A code cover sheet.
- Any Java files you have created or modified for this part.
- Screen shots showing the communication taking place between client
and various endpoints.
Last modified 21:02:26 CST 01 April 2003
by Ron K. Cytron