IRC Client

A goal of this is to create a base resource of knowledge around IRC and specifically the capturing the knowledge for both building and using IRC Clients.

Basics of IRC Client communication.

IRC is protocol that operates over a TCP/IP socket connection with ASCII encoding typically on port 6667.

In order to connect an IRC Server a socket must first be opened on the appropriate portThis is done in AS3 by using the flash.net.Socket class, and passing the hostname as a string (DNS host name or IP) and a port number as an integer.

The Socket class generates an Event.CONNECT when the connection is established, several other error events can be generated if the connection fails.
Once the socket is open the Client needs to register the connection by sending a NICK and USER command, all messages are sent to the server with the Socket method writeUTFBytes, all messages must be terminated with the ASCII character pair of CRLF (\r\n), and the flush method is called to send the queued data.