[Lazarus] SendMessage / PostMessage Verses Using NamedPipes with MessageMode.

Razvan Adrian Bogdan lightningflash at gmail.com
Thu May 13 19:53:25 CEST 2010


On Fri, May 7, 2010 at 7:11 AM, Justin Smyth
<delphian at smythconsulting.net>wrote:

> Guys now that under win32 the issues with SendMessage & PostMessage have
> been fixed under win64 i have a question to ask
>
> I have an application that i will need to send messages with payloads
> between the application and other applications ( some Located on the same pc
> and the other being located on another pc on the network ).
>
> I was tinkering with the idea to use a named pipe to send data between my
> application and the remote end ( sometimes on the local pc , sometimes on
> another pc ) and also to send information between my application and a
> deskband object dll ( toolbar application thats run from a explorer thread
> that hosts things like the start button ).
>
> Basically i would be sending a message between my application and another
> instance of my application ( could be local or remote ) to tell the
> Application to do something like stop , shutdown or process a new file ( and
> that filename would be part of the message - hence maybe with a namedpipe i
> might end up with different message sizes )
>
> Would this be an issue on a namedpipe ? ie when in messagemode can one send
> different size messages into the pipe ? or would this not work ?
>
> i only am considering this since if i dont use a named pipe i would need to
> write the code twice and have one set to use the sendmessage/postmessage for
> a local connection and another section of code to get to a remote pc ( using
> tcpip ).
>
> I've allready code some code that uses a namedpipe working to comunicate
> between the application and another instance on the same pc but havent got
> around to doing so for the something like a deskband object yet.
>
>
> Any ideas welcome , as i am just asking to clarify which would be the
> better one to use.
>

For local communication i think there is a SimpleIPC implementation done in
a CrossPlatform way, if you don't need extreme performance you could use TCP
for everything maybe with Synapse/Indy, i used Indy a lot with Delphi, it's
powerful and fast enough but quite large, i used Synapse only as a client
and i'm not sure if it's slower than Indy, never used Named Pipes so i can't
comment about their performance but i understand that they are not the same
on every platform but maybe someone found a way to abstract them ?

Razvan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20100513/3cefd5cb/attachment-0004.html>


More information about the Lazarus mailing list