CS 102 (Spring 2003)
Lab 5b: IM Bot (Part b)

Author: Ron K. Cytron and David Jurgens
Lab Assigned Design Due
(In class)
10 AM
(In Lab)
(In Lab)
Lab Due
(In lab)
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 Lab 5a.


By the end of this lab, you should

Before starting:

Signing on to the TOC server

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 TOC server.
Client sends Server sends
Signon Frame (partial)
Signon Frame (complete)
Data Frame with toc_signon
toc_add_buddy somebuddy
Many variations are possible. For example, after you sign on the server will send you a 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 CONFIG message. A list of Visitors could process every incoming message, and the CONFIG Visitor would be looking just for that message and take appropriate action.

Format of the toc_sigon message

As with all TOC commands, you place the command in a 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.
Use login.oscar.aol.com
Use 5959
One member of the team should volunteer his or her signon name for this.
The password is encrypted using a symmetric key system based on the string Tic/Toc as described in the specification. Your team should write a staticmethod to produce the encrypted string.
must be english
You can be creative here, as this tells the server the name of the client you are running.

What to do in Lab Section

What to turn in:

  1. A code cover sheet.
  2. Any Java files you have created or modified for this part.
  3. 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