Page 317 - DCAP403_Operating System
P. 317
Operating System
Notes name_x_y_z, where the server name identifies a server on the network; a share name identifi es
any resource that is made available to network users, such as directories, files, named pipes and
printers; and the _x_y_z part is a normal file path name.
Mailslots are a connectionless messaging mechanism. They are unreliable, in that a message sent
to a mailslot may be lost before the intended recipient receives it. Mailslots are used for broadcast
applications, such as for finding components on the network; they are also used by the Windows
2000 Computer Browser service.
Winsock is the Windows 2000 sockets API. Winsock is a session-layer interface that is largely
compatible with UNIX sockets, with some Windows 2000 extensions. It provides a standardized
interface to many transport protocols that may have different addressing schemes, so that any
Winsock application can run on any Winsock-compliant protocol stack.
A remote procedure call (RPC) is a client-server mechanism that enables an application on one
machine to make a procedure call to code on another machine. The client calls a local procedure-a
stub routine-that packs its arguments into a message and sends them across the network to a
particular server process. The client-side stub routine then blocks. Meanwhile, the server unpacks
the message, calls the procedure, packs the return results into a message, and sends them back
to the client stub. The client stub unblocks, receives the message, unpacks the results of the RPC,
and returns them to the caller. This packing of arguments is sometimes called marshaling.
The Windows 2000 RPC mechanism follows the widely used distributed computing environment
standard for RPC messages, so programs written to use Windows 2000 RPCs are highly portable.
The RPC standard is detailed. It hides many of the architectural differences between computers,
such as the sizes of binary numbers and the order of bytes and bits in computer words, by
specifying standard data formats for RPC messages.
Windows 2000 can send RPC messages using NetBIOS, or Winsock on TCP/IP networks, or
named pipes on LAN Manager networks. The LPC facility, discussed earlier, is similar to RPC,
except that in the LPC case the messages are passed between two processes running on the same
computer.
It is tedious and error-prone to write the code to marshal and transmit arguments in the standard
format, to un-marshal and execute the remote procedure, to marshal and send the return results,
and to un-marshal and return them to the caller. Fortunately, however, much of this code can be
generated automatically from a simple description of the arguments and return results.
Windows 2000 provides the Microsoft Interface Definition Language to describe the remote
procedure names, arguments, and results. The compiler for this language generates header
fi les that declare the stubs for the remote procedures, and the data types for the argument and
return-value messages.
It also generates source code for the stub routines used at the client side, and for an un-marshaller
and dispatcher at the server side. When the application is linked, the stub routines are included.
When the application executes the RPC stub, the generated code handles the rest.
DCOM (COM) is a mechanism for inter-process communication that was developed for Windows.
COM objects provide a well defined interface to manipulate the data in the object. Windows 2000
has an extension called DCOM that can be used over a network utilizing the RPC mechanism to
provide a transparent method of developing distributed applications.
14.5.3 Redirectors and Servers
In Windows 2000, an application can use the Windows 2000 I/O API to access files from a remote
computer as though they were local, provided that the remote computer is running an MS-NET
server, such as is provided by Windows 2000 or Windows for Workgroups. A redirector is the
310 LOVELY PROFESSIONAL UNIVERSITY