Re: Inter Process Communications

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Joseph M. Newcomer (newcomer_at_flounder.com)
Date: 01/14/05


Date: Fri, 14 Jan 2005 12:38:54 -0500

If the "server process" is a system service, you have some problems, because most of the
IPC mechanisms do not work well across desktops. In this case, you probably want to use a
named pipe. But for a simple IPC between two processes running in the same desktop, window
messages, thread messages, and with a bit of work, an I/O Completion Port.

When I use window messages, I usually do something like broadcast a Registered Window
Message which contains in its WPARAM (for example; it could have been LPARAM) the window
handle of my window. The receiving process, when it gets the message, does a PostMessage
to the window whose handle came in, containing its own window handle. Now communication is
established.

Ususally when I do this, I make sure that the processes can start up in any order. So when
a process starts up, it broadcasts "I'm the client" or "I'm the server" as window
messages, so they can be restarted in any order. If I get an "I'm the server message" as a
client, it means the server has shut down and been restarted, so as a client I reset my
target. Likewise, when, as a server, I get a new "I'm a client" it overrides the client
response previously accepted.

Note that you probably need to make sure that you can't have multiple instances of the
programs running. See my MVP Tips essay on this.
                                        joe

On Fri, 14 Jan 2005 08:34:29 -0800, "W Akthar" <anonymous@discussions.microsoft.com>
wrote:

>Hi,
>
>I need to develop a system which consists of a UI
>application and an another server process which sends and
>receives messages from a modem. I do not need to
>implement the serial communications as someone else will.
>Also most of the UI will be implemented by someone else.
>
>The thing I need to implement is the communication
>between the two processes. That is sending and receiving
>messages from the server process.
>What are the ways I can achieve this, using sockets?
>Are there any examples of implementing something similar
>to my problem anywhere on the web or can someone explain
>how I could do this?
>
>Thanks in advance !!!
>
>Cheers

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm



Relevant Pages

  • Re: TCP packets : end of thre-way handshake and start of data-transmission - how to dete
    ... " Several examples of connection initiation follow. ... packet because it would be necessary to assume a window size. ... client has already indicated a non-empty window). ... Server sends SYN/ACK and data ...
    (comp.arch.embedded)
  • Re: TCP packets : end of thre-way handshake and start of data-transmission - how to dete
    ... RFC 793 Section 3.4 (Establishing a connection) says in part: ... packet because it would be necessary to assume a window size. ... client has already indicated a non-empty window). ... Server sends SYN/ACK and data ...
    (comp.arch.embedded)
  • Re: Cannot connect to desktops on LAN using RWW or RDC
    ... > I understand that you cannot RDP to client workstations neither from LAN ... but you can RDP to the server. ... > Users cannot connect to remote desktops by using the Windows Small ...
    (microsoft.public.windows.server.sbs)
  • Re: Nothing happens after freeing kernel memory
    ... I thought using BusyBox for everything possible makes it easiest for me to ... But I saw yesterday that BusyBox provides a dhcp client. ... event occurs the entire window contents for the top window (visible ... You should know that I don't have a server here. ...
    (comp.os.linux.embedded)
  • Re: Challenge: Local App to Run in TS Session??
    ... each aisle, from above, to see if this helps saturate the warehouse better. ... Microsoft MVP - Terminal Server ... Launch Navision RDP Client (preconfigured parameters auto-connects to ... to run in a non-full-screen window, because as soon as the user clicks to ...
    (microsoft.public.windows.terminal_services)