Approaches of interprocess communication

H

Hendrik van Rooyen

exhuma.twn said:
Hi all,

Supposing you have two separate processes running on the same box,
what approach would you suggest to communicate between those two
processes.

8< ------ sockets,webservices,CORBA,shared memory ---------------
Supposing both processes are written in Python, is there any other way
to achieve this? To me, shared memory sound the most suited approach.
But as said, I am still fuzzy in this area. Where can I find more
information on this subject?

Using named pipes works for me

Also look at Pyro, albeit not aimed at being in the same box.

- Hendrik
 
D

Donn Cave

Quoth Steve Holden <[email protected]>:
| Ben Finney wrote:
....
| > If a programmer decides on behalf of the user that "localhost" should
| > be treated specially, that programmer is making an error.
|
| Inter-process TCP/IP communication between two processes on the same
| host invariably uses the loopback interface (network 127.0.0.0).
| According to standards, all addresses in that network space refer to the
| local host, though 127.0.0.1 is conventionally used.
|
| The transmit driver for the loopback interface receives a datagram from
| the local network layer and immediately announces its reception back to
| the local network layer.

Are you saying, in that first paragraph, that if for example I telnet to
my local host's external IP address, to a service that bound explicitly to
the external interface -- I'll actually be going through the loopback
interface anyway, invariably regardless of host network implementation?

Donn Cave, (e-mail address removed)
 
D

Damjan

| > If a programmer decides on behalf of the user that "localhost" should
| > be treated specially, that programmer is making an error.
|
| Inter-process TCP/IP communication between two processes on the same
| host invariably uses the loopback interface (network 127.0.0.0).
| According to standards, all addresses in that network space refer to the
| local host, though 127.0.0.1 is conventionally used.
|
| The transmit driver for the loopback interface receives a datagram from
| the local network layer and immediately announces its reception back to
| the local network layer.

Are you saying, in that first paragraph, that if for example I telnet to
my local host's external IP address, to a service that bound explicitly to
the external interface -- I'll actually be going through the loopback
interface anyway, invariably regardless of host network implementation?

On linux at least, this is true, yes.
 
S

Steve Holden

Donn said:
Quoth Steve Holden <[email protected]>:
| Ben Finney wrote:
...
| > If a programmer decides on behalf of the user that "localhost" should
| > be treated specially, that programmer is making an error.
|
| Inter-process TCP/IP communication between two processes on the same
| host invariably uses the loopback interface (network 127.0.0.0).
| According to standards, all addresses in that network space refer to the
| local host, though 127.0.0.1 is conventionally used.
|
| The transmit driver for the loopback interface receives a datagram from
| the local network layer and immediately announces its reception back to
| the local network layer.

Are you saying, in that first paragraph, that if for example I telnet to
my local host's external IP address, to a service that bound explicitly to
the external interface -- I'll actually be going through the loopback
interface anyway, invariably regardless of host network implementation?
I wasn't specifically saying that, no. However on Solaris I have
observed local connections to an external interface actually increasing
the packet count on the loopback, but I can't confirm whether those
connections were to services specifically bound only to the external
interface.

Certainly on Windows XP there is a host-specific route via 127.0.0.1 to
the external interfaces as well as the network route via the external
interface. I wouldn't necessarily expect this to extend to other
platforms. This is demonstrated by the following output from "route
print". I have chopped the metric column to avoid line wrapping.

=====================================================================
Active Routes:
Network Destination Netmask Gateway Interface
0.0.0.0 0.0.0.0 192.168.123.254 192.168.123.123
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1
192.168.123.0 255.255.255.0 192.168.123.123 192.168.123.123
192.168.123.123 255.255.255.255 127.0.0.1 127.0.0.1
192.168.123.255 255.255.255.255 192.168.123.123 192.168.123.123
192.168.174.0 255.255.255.0 192.168.174.1 192.168.174.1
192.168.174.1 255.255.255.255 127.0.0.1 127.0.0.1
192.168.174.255 255.255.255.255 192.168.174.1 192.168.174.1
224.0.0.0 240.0.0.0 192.168.123.123 192.168.123.123
224.0.0.0 240.0.0.0 192.168.174.1 192.168.174.1
255.255.255.255 255.255.255.255 192.168.123.123 3
255.255.255.255 255.255.255.255 192.168.123.123 192.168.123.123
255.255.255.255 255.255.255.255 192.168.174.1 192.168.174.1
Default Gateway: 192.168.123.254
=====================================================================

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
Blog of Note: http://holdenweb.blogspot.com
See you at PyCon? http://us.pycon.org/TX2007
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,900
Latest member
Nell636132

Latest Threads

Top