Link to home
Start Free TrialLog in
Avatar of MichaelB98
MichaelB98

asked on

Program Like ICQ...

I am trying to make an app like ICQ.  Can someone give me some pointers on how to do this...
Avatar of BoRiS
BoRiS

MichealB98

I think a good place to start is the chat program in the delphi */demos/internet directory as this will show you how to connect and chat/ the nice thing about it is that it uses TCP/IP so as long as they are on the net or on a lan they will be using the TCP/IP connection, unless they are using old technology and using IPX, but the net runnes of TCP/IP so you will always have the connection to the net, just like ICQ...

Later
BoRiS
Is an ICR example also good?
You can take a look at my sample I made for MichaelB2 at:

https://www.experts-exchange.com/topics/comp/lang/delphi/Q.10107572
The first thing that you must do is that you must define a set of chat protocol that your program will run on. Example, IRC uses the IRC protocol from the RFC1459 document which is available in the Net. Do a search for it. ICQ runs on their own set of communication protocol. Don't mixed this up with the TCP/IP protocol, they are totally
different thing. IRC and ICQ both runs on a protocol implemented in ASCII text.
An example of how an IRC server and client communicates is illustrate below.

1)IRC Server opens a port (6667) and waits for client connections.
2)When Client connecting, it has to send to the server "USER <username> <hostname> <servername> :<realname> <delimiter*>" followed by a "NICK <nickname> <delimiter*>"
to identify themselve on the server.

<delimiter> in the IRC protocol is made up of CR and  LF as to mark the end of message. As you probably know that TCP/IP send data in small packets, thus sometimes, a huge single message may be break up into many smaller packets when transmitting, a delimiter is needed to tell the peer on the other side that the message has arrived in full instead of broken pieces of messages.

3)The Server then checks if the <nickname> already existed, if yes, then a message will
be sent back to the client asking for another Nickname, else the client is logged into the server thus known as Registered.
4)Clients after registering themselves can then do whatever permitted on that server / chat protocol.

Procedure (2) is known as handshaking, which is define in the RFC1459 doc. Different sets of protocols has different handshake methods. Thus, its impossible for an IRC client
to log onto an ICQ server even though u can set the server to icq1.mirabilis.com:4000 in the IRC client. Their handshake method don't match.

Well, After you get a cool chat protocol drawn up, you can easily design your chat system from it. I advice you to get RFC1459 and study how a chat protocol looks like.
From there, you can choose to define your own new protocol or just use the IRC protocol,
maybe adding some new rules or commands into it. Hmm, if this is still not enough or that i'm getting what you are asking, just let me know.

ASKER CERTIFIED SOLUTION
Avatar of skatan187
skatan187

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'm making a program like ICQ since a few months ago.. do you still need help ?
I can chat with someone and notify font changes, sleep function, multiple messages/url's, file sending with possibility to pause, and some more things.. my next step is to make it able to chat with multiple ppl.. I'm also doing the online server..

I used Fpiette's components so they are much more good than delphi ones..