Recent

Author Topic: IPC or Pipe?  (Read 9979 times)

Dibo

  • Hero Member
  • *****
  • Posts: 1055
IPC or Pipe?
« on: February 01, 2011, 09:17:37 pm »
Hi,

I am new in this things. I need very simple solution for communication between two applications:

1. I will send only text (xml)
2. Must be cross platform (I need for windows and linux)
3. Must be some standard solution - easy implementation in clients written in other language (python, C++, etc)
4. Server should be able to response to client. I need only simple response (true, false)

All points except 4 meets SimpleIPC. It's exactly what I need, but don't know how to send answer to client. I need response, because I want force simple "greeting" in clients with some params. Server should accept or refuse this greeting and client should know the answer. The only way is create another connection from server to client?
I am looking now on pipes, but I don't know how to use it. Documentation is without example:
http://www.freepascal.org/docs-html/fcl/pipes/index.html

Regards

P.S. Is it possible to detect IPC/Pipe client file path?
« Last Edit: February 01, 2011, 09:21:37 pm by Dibo »

javivf

  • New Member
  • *
  • Posts: 14
    • http://javivf.alasombra.net/blog
Re: IPC or Pipe?
« Reply #1 on: February 02, 2011, 10:21:39 am »
You can use TSimpleIPCServer and TSimpleIPCClient at same side, then you have two-way IPC mechanism ;)

client := TSimpleIPCServer + TSimpleIPCClient;
server := TSimpleIPCServer + TSimpleIPCClient;

Dibo

  • Hero Member
  • *****
  • Posts: 1055
Re: IPC or Pipe?
« Reply #2 on: February 02, 2011, 11:20:52 am »
Yes, I wrote about this above :P . I thought that the IPC has a mechanism of signals or something similar

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1931
Re: IPC or Pipe?
« Reply #3 on: February 02, 2011, 11:43:06 am »
Yes, I wrote about this above :P . I thought that the IPC has a mechanism of signals or something similar

The term IPC does not stand for a specific technique: http://en.wikipedia.org/wiki/Inter-process_communication

Dibo

  • Hero Member
  • *****
  • Posts: 1055
Re: IPC or Pipe?
« Reply #4 on: February 02, 2011, 12:16:23 pm »
Hm, maybe I just use TCP server on local host?

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1931
Re: IPC or Pipe?
« Reply #5 on: February 02, 2011, 12:38:13 pm »
Hm, maybe I just use TCP server on local host?

Yes, why not. Choose a reasonable port number.

Dibo

  • Hero Member
  • *****
  • Posts: 1055
Re: IPC or Pipe?
« Reply #6 on: February 02, 2011, 01:28:53 pm »
I look into SimpleIPC source on windows. It is only set of friendly functions for WM_COPYDATA and Post/SendMessage. Cleverly :)

 

TinyPortal © 2005-2018