Sever Side Chat Application with Borland Delphi/Indy
This article will get you started on building a chat application based on the client/server model. It will be able to handle all of the basics found in chat applications like Microsoft Messenger and others.
Sever Side Chat Application with Borland Delphi/Indy - Handling Commands: Listnames, all, takeshot (Page 4 of 5 )
Command: Listnames
When the server receives this command it collects all the nick names of the connected clients and sends it off to the requesting client. Here’s the procedure that handles this:
Next, I needed a procedure to convert bitmap images to jpeg format, because Delphi only works in the bitmap format. Also, when you send a picture over the Internet it is always best to use a format that does not take up a lot of space and that is Internet ‘friendly’.
As the name suggests, the procedure takes a screenshot and saves it in a file called 'scrnshot.bmp'. This file will then be converted to jpeg format, before it is sent off to the requesting client. So, it is essential that this procedure is called before the bmptojpg procedure.