This document "The AOL Protocol" gives in depth information on the login and handshaking between the AOL client and servers:
http://www.aol-files.com/misc/theaolprotocol.wri
Also visual basic source code and more at:
under "AOL Protocol & Sign on and IM example"
Finally a nearly full, but unofficial specification for the AIM protocol at "FAIM":
http://www.zigamorph.net/faim/protocol/
Great information for anyone who might think about implementing either of these very popular services under OS/2.
Source: