Melbourne Meeting – January 2018
Monday 15th January.
We had three presentations on different types of inter-process communication.
Brian Watson spoke about MailSlots and how they could be used to communicate between programs running on different computers.
He explained how mailslots allowed one program to broadcast messages and other programs to receive them. Sending the messages was very similar to writing to a file. The receiver is notified by an event containing the message.
Tony Bryer spoke about named pipes, semaphores and mutexes.
He explained how mutexes could be used to ensure that only one copy of a program could run at a time, and how semaphores could be used to control access to limited resources.
He then showed us how named pipes could be used to communicate between programs on different machines.
He referred to an example at http://cc.embarcadero.com/item/21893
John McDonald spoke about sockets.
He showed how to use the TIpTcpServer and TIpTcpClient components to setup socket communication. One server component could handle communication with multiple clients.
Indy sockets are blocking, but the TIpTcpServer made multithreaded handling of messages easy.
He then showed how an anonymous method could make thread safe interactions with the VCL very simple:
The anonymous method in the following method captures the Text parameter
procedure TIndyServerForm.QueueLineForMemoBox(const Text: string); begin TThread.Queue(nil, procedure begin MemoBox.Lines.Add(Text); end); end;
so this method can be called from a different thread without having to wait for the main thread.
The meeting was held at the Melbourne Men’s Shed, situated in the Federation Square Car Park building, off Russell St Extension.