Xojo Conferences
XDCMay2019MiamiUSA

Fastest way to exchange data between applications. (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: Re: Structures
Next thread: Listbox Drop Object


Fastest way to exchange data between applications.   -   lveillette
  Re: Fastest way to exchange data between applications.   -   James Sentman
  Re: Fastest way to exchange data between applications.   -   Jean-Luc Arnaud
   Re: Fastest way to exchange data between applications.   -   Joe Strout
  Re: Fastest way to exchange data between applications.   -   Jean-Luc Arnaud
   Re: Fastest way to exchange data between applications.   -   Jan-Ivar Mellingen
  Re: Fastest way to exchange data between applications.   -   Jean-Luc Arnaud
   Re: Fastest way to exchange data between applications.   -   Jan-Ivar Mellingen
   Re: Fastest way to exchange data between applications.   -   Joe Strout
  Re: Fastest way to exchange data between applications.   -   Christian Schmitz
  Re: Fastest way to exchange data between applications.   -   Norman Palardy
  Re: Fastest way to exchange data between applications.   -   lveillette
   Re: Fastest way to exchange data between applications.   -   Norman Palardy
  Re: Fastest way to exchange data between applications   -   lveillette

Fastest way to exchange data between applications.
Date: 10.08.09 13:49 (Mon, 10 Aug 2009 08:49:48 -0400)
From: lveillette
I have two applications and I would like to share data in between them in
the fastest possible way. That data isn't much, just between one and a few
hundred bytes at each exchange, but I need to exchange those bytes as fast
as possible.

- At first I was considering sending AppleEvents in between them, but it
might require a lot of overhead,

- Or I was thinking maybe UDP socket, but since it all happens in the same
computer, I probably wouldn't get to speed either because of all the network
interaction that I don't really need,

- Even better would probably be to share some memory in between application,
but I'm not sure how this can be done in RB...

- Suggestions about any other way that would be even better are of course
welcome...

Louis


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Fastest way to exchange data between applications.
Date: 10.08.09 15:54 (Mon, 10 Aug 2009 10:54:00 -0400)
From: James Sentman

On Aug 10, 2009, at 10:40 AM, Jean-Luc Arnaud wrote:

>> I am routinely communicating between a lot of applications (several
>> hundreds, most of them 'assistants' to the master application).
>> Mostly
>> they reside on a single computer, but occasionally they are
>> distributed
>> on a LAN.
>> For this I use UDP Multicast. All applications subscribe to the
>> Multicast group and receive all messages. UDP is connectionless and
>> thus
>> has a lot less overhead and is substantially faster than TCP.
>> Because it
>> is connectionless each message may need an acknowledge of some
>> kind, but
>> the whole logic is in my case easier than supervising/reconnecting
>> TCP
>> connections.
>>
>> Regards,
>> Jan-Ivar Mellingen
>>
> Very interesting. Could you provide some examples, or some URLs with
> detailed information, please ?
>
> What do you think about ServerSocket ? Did you experiment it ?


But if ALL your helper apps receive all the messages, even those
messages not for them, then you multiply the parsing and packet
handling by a hundred times unnecessarily. Is TCP to a specific helper
instance so much slower that this is still better?

Thanks,
James

James Sentman http://sentman.com http://MacHomeAutomation.com



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Fastest way to exchange data between applications.
Date: 10.08.09 15:42 (Mon, 10 Aug 2009 16:42:32 +0200)
From: Jean-Luc Arnaud
>Jean-Luc Arnaud wrote:
>
>>But, if no error from me, you can have just one IPCSocket at a time.
>
>Incorrect.
>

Sorry for this bad info.
How does it work ? Multi-instances of IPCSocket class ? Or what else ?

Thanks for details.

Jean-Luc

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Fastest way to exchange data between applications.
Date: 10.08.09 16:48 (Mon, 10 Aug 2009 09:48:47 -0600)
From: Joe Strout
Jean-Luc Arnaud wrote:

>>> But, if no error from me, you can have just one IPCSocket at a time.
>>
>> Incorrect.
>
> Sorry for this bad info.
> How does it work ? Multi-instances of IPCSocket class ?

Yes. Each IPCSocket communicates with one other app, but you can have
as many of these IPCSockets as you like.

Best,
- Joe

Re: Fastest way to exchange data between applications.
Date: 10.08.09 15:40 (Mon, 10 Aug 2009 16:40:25 +0200)
From: Jean-Luc Arnaud
>I am routinely communicating between a lot of applications (several
>hundreds, most of them 'assistants' to the master application). Mostly
>they reside on a single computer, but occasionally they are distributed
>on a LAN.
>For this I use UDP Multicast. All applications subscribe to the
>Multicast group and receive all messages. UDP is connectionless and thus
>has a lot less overhead and is substantially faster than TCP. Because it
>is connectionless each message may need an acknowledge of some kind, but
>the whole logic is in my case easier than supervising/reconnecting TCP
>connections.
>
>Regards,
>Jan-Ivar Mellingen
>

Very interesting. Could you provide some examples, or some URLs with
detailed information, please ?

What do you think about ServerSocket ? Did you experiment it ?

Thanks a lot.

Jean-Luc

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Fastest way to exchange data between applications.
Date: 13.08.09 14:23 (Thu, 13 Aug 2009 15:23:17 +0200)
From: Jan-Ivar Mellingen

Jean-Luc Arnaud skrev:
> Very interesting. Could you provide some examples, or some URLs with
> detailed information, please ?
I'm sorry that I cannot give you my libraries unmodified, and I am too
busy at the time being to make some useful samples.

Some info on UDP Multicast can be found on
http://tldp.org/HOWTO/Multicast-HOWTO.html

Basically you join a multicast group in RB like this:
UDPSocket1.RouterHops = 2 // A low value can limit the messages to
a single PC, use a high value (16-64) for LAN
UDPSocket1.Port = 56789 // tip1
// UDPSocket1.NetworkInterface= 192.168.1.123 // tip2
UDPSocket1.Connect
if UDPSocket1.JoinMulticastGroup(sMulticastGroupAddress) then ...

tip1:
It does not hurt to spend some thoughts on selecting suitable port
numbers.
Dynamic and/or Private Ports are those from 49152 through 65535.
Ref http://www.iana.org/assignments/port-numbers and
http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers
tip2:
.NetworkInterface is important if you have multiple NIC's, all apps
on same PC must use same NIC in order to avoid some mysterious
communication errors! Omit if you have only one network interface.
note:
The Multicast adresses are those from 224.0.0.0 - 239.255.255.255 -
pick any you like. They have NO correlation to your LAN addresses! Note
also that multicast group 224.0.0.x is reserved for some purpose.

>
> What do you think about ServerSocket ? Did you experiment it ?
I have not used ServerSockets yet, but it is more than likely that I
will use them for most of my TCP server applications.

/Jan-Ivar

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Fastest way to exchange data between applications.
Date: 10.08.09 14:43 (Mon, 10 Aug 2009 15:43:33 +0200)
From: Jean-Luc Arnaud
>Am 10.08.2009 um 14:49 schrieb lveillette:
>
>>
>>- Suggestions about any other way that would be even better are of course
>>welcome...
>>
>Use IPCSockets.
>
>They use shared memory in background without you needing to handle
>synchronization.
>
>Greetings
>Christian
>

But, if no error from me, you can have just one IPCSocket at a time.
If right, how exchange datas between more than 2 apps ?

I.E. : Master app and 2 or more slave apps.

Could not be easier with ServerSocket ?

Jean-Luc

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Fastest way to exchange data between applications.
Date: 10.08.09 15:17 (Mon, 10 Aug 2009 16:17:59 +0200)
From: Jan-Ivar Mellingen
I am routinely communicating between a lot of applications (several
hundreds, most of them 'assistants' to the master application). Mostly
they reside on a single computer, but occasionally they are distributed
on a LAN.
For this I use UDP Multicast. All applications subscribe to the
Multicast group and receive all messages. UDP is connectionless and thus
has a lot less overhead and is substantially faster than TCP. Because it
is connectionless each message may need an acknowledge of some kind, but
the whole logic is in my case easier than supervising/reconnecting TCP
connections.

Regards,
Jan-Ivar Mellingen

Jean-Luc Arnaud skrev:
>> Am 10.08.2009 um 14:49 schrieb lveillette:
>>
>>>
>>> - Suggestions about any other way that would be even better are of
>>> course
>>> welcome...
>>>
>> Use IPCSockets.
>>
>> They use shared memory in background without you needing to handle
>> synchronization.
>>
>> Greetings
>> Christian
>>
> But, if no error from me, you can have just one IPCSocket at a time.
> If right, how exchange datas between more than 2 apps ?
>
> I.E. : Master app and 2 or more slave apps.
>
> Could not be easier with ServerSocket ?
>
> Jean-Luc
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Fastest way to exchange data between applications.
Date: 10.08.09 15:13 (Mon, 10 Aug 2009 08:13:04 -0600)
From: Joe Strout
Jean-Luc Arnaud wrote:

> But, if no error from me, you can have just one IPCSocket at a time.

Incorrect.

> Could not be easier with ServerSocket ?

Easier, perhaps, but probably not faster. Also using TCP/IP, even
locally, will sometimes cause security systems to bark.

Best,
- Joe

Re: Fastest way to exchange data between applications.
Date: 10.08.09 14:11 (Mon, 10 Aug 2009 15:11:07 +0200)
From: Christian Schmitz

Am 10.08.2009 um 14:49 schrieb lveillette:

>
> - Suggestions about any other way that would be even better are of
> course
> welcome...
>

Use IPCSockets.

They use shared memory in background without you needing to handle
synchronization.

Greetings
Christian


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Fastest way to exchange data between applications.
Date: 11.08.09 02:47 (Mon, 10 Aug 2009 19:47:12 -0600)
From: Norman Palardy

On 10-Aug-09, at 6:49 AM, lveillette wrote:

> I have two applications and I would like to share data in between
> them in
> the fastest possible way. That data isn't much, just between one and
> a few
> hundred bytes at each exchange, but I need to exchange those bytes
> as fast
> as possible.
>
> - At first I was considering sending AppleEvents in between them,
> but it
> might require a lot of overhead,
>
> - Or I was thinking maybe UDP socket, but since it all happens in
> the same
> computer, I probably wouldn't get to speed either because of all the
> network
> interaction that I don't really need,
>
> - Even better would probably be to share some memory in between
> application,
> but I'm not sure how this can be done in RB...
>
> - Suggestions about any other way that would be even better are of
> course
> welcome...

Try an IPCSocket
You may be very surprised at how fast they can be

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Fastest way to exchange data between applications.
Date: 12.08.09 05:13 (Wed, 12 Aug 2009 00:13:51 -0400)
From: lveillette
> Try an IPCSocket
> You may be very surprised at how fast they can be
True, there's almost no lag time. And they are easy to set up too!

I love these!

Thanx to you and everyone who answered with other interesting tips. I'd be
curious to make a little benchmark application that implements all methods,
but I'm quite sure that IPCSocket are the fastest, and probably UDP, if I
needed to work over a network, although TCP is a good idea too if you need
more control.

Louis


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Fastest way to exchange data between applications.
Date: 12.08.09 05:43 (Tue, 11 Aug 2009 22:43:37 -0600)
From: Norman Palardy

On 11-Aug-09, at 10:13 PM, lveillette wrote:
>
> Thanx to you and everyone who answered with other interesting tips.
> I'd be
> curious to make a little benchmark application that implements all
> methods,
> but I'm quite sure that IPCSocket are the fastest, and probably UDP,
> if I
> needed to work over a network, although TCP is a good idea too if
> you need
> more control.

and reliability

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Fastest way to exchange data between applications
Date: 12.08.09 05:03 (Wed, 12 Aug 2009 00:03:56 -0400)
From: lveillette
>Use IPCSockets.
It works just fine!

I think I'll recode some of my application that use AppleEvents...

Thanx for the precious help, as usual...

Louis


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>