Home arrow Delphi-Kylix arrow Building an IRC Client
DELPHI-KYLIX

Building an IRC Client


If you have ever wanted to build your own IRC client, keep reading. In this third part of a three-part article series, you will learn how to build an IRC client in Delphi from scratch, with assistance from Indy. While not all possible commands will be implemented, you will learn enough to add to and modify the code as you see fit.

Author Info:
By: Leidago
Rating: 5 stars5 stars5 stars5 stars5 stars / 13
January 22, 2007
TABLE OF CONTENTS:
  1. · Building an IRC Client
  2. · Procedures
  3. · More Procedures
  4. · Sending Messages
  5. · Processing Server Commands

print this article
SEARCH DEVARTICLES

Building an IRC Client
(Page 1 of 5 )

IRC Client

In the previous two articles we discussed what an IRC client is and how it works.  We also looked at the IRC protocol from the point of view of the RFC in which it is defined. Then we considered how we can implement such a client in Delphi and looked at what components we can use to fulfill that aim.  We then decided to use a component called idIRCClient with which to create a IRC client. In the last article we looked at how much of the protocol this component can implement and found that it implements most of the commands required to create a client application. In this article we are going to focus on creating an IRC client from scratch. 

What you need

To build this client I'm using Delphi 7 and indy version 10.1.5. I unfortunately don't know if this application will work on any other version of Delphi as I don't have access to those versions. So it will be up to you to test them. Your indy version will have to be the one I have or newer, because the versions are constantly updated and the implementations do not remain the same.

The Application

On the question of how many of the commands to implement to have a comfortably working client, I will implement as many of the commands as possible and also give pointers on how to implement others. The reason for this is that many IRC servers will accept and work comfortably with clients that have a minimal implementation and others won't. So in effect, the more commands you implement the more your client will be able to work with all kinds of IRC servers and networks. When you've finished writing your application, try to connect to as many IRC servers/networks as possible, because some will not accept you, and others will.

Here is a quick summary of how a client works:

  • Default port is set to 6667.
  • You need a (unique) nick name to connect to a IRC network.
  • Some networks will require you to register, so you will need a username and password.
  • You need the name of the IRC network, i.e irc.ukchatterbox.com and the name of the channel, i.e #talkmore.

Start up Delphi, create a new application, and drop the following components:

  • idIRCClient - available from the Indy Client tab
  • Three editboxes  - available from the Standard tab. These will be used to receive user info, such as the nickname.
  • Two memo components - available from the Standard tab. These will be used to both display and accept user input.
  • Three buttons (captions, Connect/Say something, and Join) - available from the Standard tab.
  •  Five tlabels - available from the Standard tab

Arrange them so they look something like this:


blog comments powered by Disqus
DELPHI-KYLIX ARTICLES

- Loading an XML Document into the DOM
- Delphi Wrapper Classes and XML
- Delphi and the DOM
- Delphi and XML
- Internet Access: Client Service
- Finishing the Client for an Internet Access ...
- The Client for an Internet Access Control Ap...
- User Management for an Internet Access Contr...
- Important Procedures for an Internet Access ...
- Server Code for an Internet Access Control A...
- Constructing the Interface for an Internet A...
- Building a Server Application for an Interne...
- Building an Internet Access Control Applicat...
- Client Dataset: Working with Data Packets an...
- Using the Client Dataset in an N-Tiered Appl...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials