Interprocess communication and crisp, Ipc mechanisms – Crunch CRiSP File Editor 6 User Manual

Page 79

Advertising
background image

Page 79

keyword="union"

keyword="while" "write"

Interprocess Communication and CRiSP

Interprocess communication is the means to allow other programs to communicate with CRiSP, or vice
versa. IPC communication is a very powerful mechanism for extending an existing application or CRiSP. For
example, CRiSP provides IPC communication when dealing with shell buffers, compilation commands and
filtering.

Probably the most frequently asked question by users is how to tell CRiSP to edit a file automatically and
position itself to view a particular line in the file. This is easily achieved using any of the IPC mechanisms
described below.

CRiSP provides a variety of IPC mechanisms because there is no one universal best IPC mechanism - each
mechanism has its own advantages and disadvantages.

The following sections describe the IPC mechanisms in more detail and how to program them in the
CRUNCH language.

IPC Mechanisms(pg. 79).

IPC Primitives(pg. 80).

IPC Callbacks(pg. 80).

TCP/UDP Communications(pg. 81).

Pipe Communications(pg. 84).

PTY Communications(pg. 84).

DDE Communications(pg. 85).

Signal Communications(pg. 86).

IPC Mechanisms

CRiSP supports one or more of the following IPC mechanisms. The actual mechanisms supported are
platform specific.

TCP/UDP(pg. 81).

TCP/UDP is probably the best communication mechanism. Using either of these

protocols allows communication between CRiSP and applications either on the same
machine or remote machines.

From a programming perspective, both protocols are very similar. The major difference is
that TCP is a connection oriented protocol, meaning that you have to establish connection
with another task on the network before communication can commence. The resulting
connection is reliable in the sense that the underlying protocol architecture does its best to
handle errors in the data stream and retransmits lost packets.

UDP is connectionless and unreliable. If a packet gets lost somewhere on the network, it
is up to the applications using the protocol to discover and take remedial action. UDP is
more lightweight than TCP and is more suitable for certain classes of communication, e.g.
statistical status monitoring.

Pipes(pg. 84).

Pipes are a communication mechanism that is suited for communication between two
tasks on the same machine.

Under Unix, there are two types of pipes - anonymous pipes and named pipes.
Anonymous pipes are suitable for a parent process to talk to a child process. Named
pipes are very similar but are more suitable when there is no parent-child relationship.

Windows/32 supports anonymous and named pipes as well. CRiSP does not currently

Advertising