[fpc-pascal] Best way to transfer data between applications?
Jorge Aldo G. de F. Junior
jagfj80 at gmail.com
Tue Oct 30 03:53:11 CET 2012
I have a very simple unit that uses RTTI to stream class instances to
and from strings/streams.
i believe this is an easy foundation on wich to develop something
along the lines of what you are trying to do
2012/10/29 Frank Church <vfclists at gmail.com>:
>
>
> On 29 October 2012 09:43, Michael Van Canneyt <michael at freepascal.org>
> wrote:
>>
>>
>>
>> On Mon, 29 Oct 2012, 印場 乃亜 wrote:
>>
>>> Greetings,
>>>
>>> I am familiar with the basic underlying methods available for
>>> transferring data between processes on Windows and Unix, i.e. Pipes, Shared
>>> memory, and TCP/IP - but what I am not familiar with is any higher level
>>> functionality that may be available on FPC.
>>>
>>> As an example: I have one application with a daemon that uses the IPC
>>> component to write to a file in CSV format, and then the user application
>>> reads this (GPS location) data via IPC. Then I have to re-convert this
>>> string data into a series of floating point values manually, though. The
>>> IPC component doesn't seem to be reliable on all platforms either (it
>>> sometimes blocks on OS X, and at least the debug client doesn't seem to work
>>> at all on Windows 7).
>>>
>>> Another disadvantage is that the sequence of launching the applications
>>> matters, and what's more, it seems there can only be one "client" per
>>> "server" in many cases.
>>>
>>> More to the point, if I want to pass around structures, records,
>>> etc.between processes - what is the best day? For example, Javascript uses
>>> JSON. I know there are JSON libraries and various other libraries for
>>> Pascal - but I don't know what is the most standard way. (I think this kind
>>> of marshalling/unmarshalling may be more standard in Java and C#, but I
>>> don't know the "normal" way in Delphi/FPC).
>>>
>>> I would prefer to use built-in functionality, rather than learn yet
>>> another library - and if learning a library, I would prefer to use one
>>> with lots of users that is actively maintained. Likewise, I would prefer
>>> to actually "pass" the data, rather than just pass a pointer to it. I
>>> plan to have the processes run on the same machine, so I don't need a
>>> solution that works with networking, though that would be fine, of
>>> course.
>>>
>>> Along the same lines, a convenient way to call functions/procedures with
>>> parameters from the "other" process would be greatly appreciated. (i.e.
>>> something like RPC that handles OOP).
>>
>>
>> You should try WST.
>>
>> It's perfectly suitable for all this. It is actively used and maintained.
>> You can choose which encoding (binary, soap, JSON) is used, and which
>> protocol (Direct library, TCP socket, http).
>>
>> Michael.
>> _______________________________________________
>> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
>
>
> I have to second Michael's response. Inoussa discussed on some thread some
> time back and in fact I am lookiing to read it again.
> Does anyone recall that thread?
> --
> Frank Church
>
> =======================
> http://devblog.brahmancreations.com
>
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
More information about the fpc-pascal
mailing list