beautypg.com

1 lm named pipes – Siemens Unix V4.0 User Manual

Page 18

background image

Introduction to Advanced Server for UNIX

Shared resources

Product Manual

U7613-J-Z815-6-76

©

S

iem

e

n

s

N

ix

dor

f

In

fo

rm

at

io

n

s

s

y

s

te

m

e

A

G

1

9

9

5

P

fad

: D:

\O

7

613

e6

\u

761

3e

.k

02

2.2.6.1

LM named pipes

Advanced Server for UNIX also provides LM named pipes. They are bidirectional commu-
nication channels for interprocess communication in the network. They differ from UNIX

®

named pipes.

The following example describes the basic procedure for setting up and clearing down an
LM named pipe: An application process with

root

authorization creates a named pipe on the

server. The client process on the client sets up a connection to the known named pipe over
the local network. Both processes can then exchange data using the LM named pipe. When
the data exchange has ended, the LM named pipe is deleted.

Advanced Server for UNIX must be running in order to use LM named pipes.

Example

The

root

-authorized process on the server

server1

creates a LM named pipe with the name

srvp

using the function

DosMakeNmPipe (“/PIPE/srvp” , &reference,...)

and waits using the

function

DosConnectNmPipe (reference)

for a connection to be set up

(_dos_open)

to the client

process.

The client process – under MS-DOS, OS/2, Windows, Windows for Workgroups,
Windows NT or Windows 95/98 – opens the named pipe with

_dos_open ("\\\\server1\\PIPE\\srvp",&cfd,...),

and data can now be exchanged between the

processes.

The character “\” must always be specified twice in a C program since the first “\” is

interpreted as an escape character.

The connection to the LM named pipe is set up using the resource

IPC$

. If a client process

on a client wishes to communicate with an application process on the server, this resource
is connected automatically.

If the LM named pipe is to be closed again after the data exchange, the client process clo-
ses this named pipe using _

dos_close(cfd)

.

The server process can then clear down the connection using

DosDisconnectNmPipe(reference)

and delete the named pipe using

DosClose(reference)

.

Further information on LM named pipes can be found in the manual

API Reference”

and

in the manual pages for the API.

i

i