Suggestions for Writing a TCP IP Messaging System (Client / Server) Using Delphi 2010

I would like to write a messaging system using TCP IP in Delphi 2010. I would like to know what are my best options for using the standard delphi 2010 components / indy components for this.

I would like to write a server that listens and forwards messages to all the machines on the network where the client is running.

1.) a.) Clients can send a message to the server for forwarding to all other clients b) clients listen to messages from other senders (through the server) and display messages.

2.) a.) The server can send a message to all clients b.) The server forwards any messages from clients to all other clients.

thanks for any suggestions

NOTE. I am not writing an instant messenger or chat program. This is just a system in which users can send alerts / messages to other users - they cannot reply to each other! NO commercial, shareware, etc. Links - please! I would like to hear about how you are going to write this type of system and what approaches you will take, and possibly the TCP IP protocol exchange architecture that you will use. Whether it's the direct Winows API, Indy components, etc. Etc.

+4
source share
6 answers

If it is only Windows and you do not want to use third-party libraries, you can skip TCP / IP and switch to Mailslots .

Edit : if you want guaranteed delivery, the named connection will be a more reliable solution. This SO question contains some nice answers with sample examples named Delphi.

A mailbox is a mechanism for one-way interprocess communication (IPC). Applications can store messages in the mail slot. The owner of the mailbox can retrieve the messages that are stored there. These messages are usually sent over the network or to the specified computer or to all computers in the specified domain. A domain is a group of workstations and servers that specify the name of the group.

They do not need a Windows domain; they work through a local network.

DelphiPages has a nice crash when performing IPC in Delphi , including mailboxes.

- Jeroen

+4
source

If you want to save some work and use a ready-made solution:

in the following order. The latter two are listed for informational purposes only.

IMO 0MQ is the best choice - it is thoughtful, lightweight, fast and reliable.

+3
source

It looks like sending messages for publication. kbmMW offers one.

0
source

To ensure reliable operation, this is more work than you think - put 5% of the effort to make it work, and 95% of the effort to make it work under any circumstances, including network drops, etc. If you go here ( http://www.csinnovations.com/framework_delphi.htm ) you can see how I implemented my interprocess communication infrastructure. TCP content contains about 10,000 lines of code using Indy components.

0
source

About using indy, for example in this demo: indy10clieservr.sourceforge.net OR using TServerSocket and TClientSocket

-> now with an INDY x64 demo

0
source

Source: https://habr.com/ru/post/1333226/


All Articles