How To Produce a Java TOC2 Class Which Can Contact Aim
AOL Instant Messenger is one of the most popular instant messenging tools available today. It allows you to send instant messages to other people who use AIM. At the same time, it is possible to heavily customize AIM programs by using a protocol which is named TOC2.
AOL has released an API that people can use to connect to it. In this article I will teach you a method for designing your own chat program using TOC2.
There are a number of reasons why you should want to combine AIM with a computer program. While it is possible to generate your own chat program, the real benefit lies in creating programs that you can chat with like you would with a live person. For example, if you want to get information about your servers, you could use this program to ask your server to provide you with information. There are other impressive things you can do with instant messaging programs. To effectively use the chat network offered by AOL, you will need to use a protocol which is known as TOC. AOL recently updated TOC into TOC2. Even though the update only produced a small number of changes, the update destroyed the connection to the older protocol.
Because of this, many people thought that AOL had decided to stop the use of third party programs on their network. However, AOL didn’t do this, and it is not necessary for third party developers to upgrade their existing software to TOC2. Some programmers learned this the hard way. They would write a basic Java class that would connect to AIM through TOC, and their class would suddenly break. If you want to use TOC, you can start by using the API units that come with Java. These packets will have to be traded with the server. These packets are named FLAPs, and they contain a bit of ASCII text that will give information about the TOC command that you want to use.
The FLAP packets are simple, and use a basic format. The communications with the TOC server will need to come in the form of FLAPs. The twin packets that are sent to you by the TOC server must be in the form of FLAPs as well. The FLAP will come in the form of 6 bytes, and these are Byte 0, Byte 1, Bytes 2 and 3, Bytes 4 and 5, and Byte 6-. Bytes 2 and 3 are connected and Bytes 4 and 5 are connected as well. These two pairs are named words. The words will always be transferred as special numbers. To write a word, you will need to use a specific technique.
Each FLAP will begin with the "*"symbol. The sequence of number will be added next. The length of the characters will be transferred as well. All FLAP packets will be transferred this way with the exception of the signon. The flap signon will be transferred with the sendFlapSignon technique. The reason for this is because the signon packet utilizes a different format. A getFlap technique will also be given. This technique will allow a FLAP packet to be read from a distant computer and will return a line of characters that will hold the information within that packet. The code below will give you can example of this:
protected String getFlap()
throws IOException
{
if ( is.read()!=’*’ )
return null;
is.read();
is.read();
is.read();
int length = (is.read()*0x100)+is.read();
byte b[] = new byte[length];
is.read(b);
This technique will read a FLAP packet, and as you can see, the "*" must be used. The others fields are basically ignored. The length is important because it allows the correct number of characters to be read. It is possible for you to create connections with the TOC server to send and receive messages from it. There are two types of servers you will deal with, and these are the login server and the TOC server. The TOC server can be found at toc.oscar.aol.com. It is port 9898. The login server can be found at login.oscar.aol.com, and is port 5190.