Named Pipes vs. Mail Slots for Broadcast-Based Programs (61797)
The information in this article applies to:
- Microsoft LAN Manager 1.1
- Microsoft LAN Manager 2.0
- Microsoft LAN Manager 2.1
- Microsoft LAN Manager 2.1a
- Microsoft LAN Manager 2.2
This article was previously published under Q61797 SUMMARY
Question:
Are mail slots the preferred method to be used with broadcast-based
communication applications on an OS/2 LAN-Manager-based LAN?
Also, does the mail slot API use NetBIOS broadcasts to implement its
broadcast call?
Response:
Many application-specific requirements must be considered when making
a decision as to whether to use named pipes or mail slots for a
broadcast-based OS/2 LAN communications program.
To help answer the questions above, let's review how named pipes and
mail slots work.
Named Pipes
When a workstation connects to a named pipe that has been established
on a server (or peer service workstation), a session (NetBIOS virtual
connection) is established between the two network nodes. This virtual
connection (VC) is maintained until either node explicitly closes the
pipe. Therefore, named pipes provide an efficient platform for
frequent data transfer as the underlying protocols do not have the
extra overhead of creating and dropping a session each time an
instance of data is transferred. Moreover, data written to the named
pipe is guaranteed to reach its destination.
The down side to using named pipes is that a session is taken up for
each internodal VC, which tends to deplete the session pool. Please
note that if a session has been established with a workstation (for
example, by a NET USE done earlier), the named pipe will use this same
session. Therefore, if A and B already have a session established
between them, the creation of a named pipe will not add another
session. Also, please note that OS/2 LAN Manager is designed to
minimize session pool depletion owing to its transparent
auto-disconnect/reconnect feature and its efficient exploitation of
the network interface unit session handling capability.
Remember that a named pipe can be created only by a server or by an
OS/2 workstation that is configured as a peer server. An OS/2
workstation (no server service running) or a DOS workstation can read
from and write to a named pipe but can never create one.
Mail Slots
OS/2 LAN Manager offers two types of mail slots: first class and
second class.
First class mail slots work like a temporary named-pipe session. When
mail is sent, a session is established, the instance data is
transferred, and then, after a time-out period, the session is
dropped. Like named pipes, first class mail slots provide secure,
guaranteed delivery. First class mail slots are useful where
guaranteed delivery is essential, but where instances of data transfer
to any given node are expected to be sporadic or seldom.
First class mail slots can ONLY be used to send data from a DOS or
OS/2 workstation (or OS/2 server) to an OS/2 server, and cannot be
used for peer data transfer between DOS workstations and/or OS/2
workstations (without the server service).
Unlike first class mail slots, second class mail slots use the NetBIOS
broadcast function to send data. Therefore, a VC is never established.
Second class mail cannot be guaranteed. Thus, the sender will never
know if the message reached its destination unless within the message
the sender asks the receiver to return confirmation of receipt. This
(if required) could potentially add significant overhead as the sender
can spend a lot of time resending the message until a confirmation of
receipt is finally obtained.
However, if guaranteed delivery is not required, second class mail is
a good platform for high-speed messaging owing to low overhead (no
need to create/drop sessions to guarantee delivery). As an added
bonus, second class mail slots can be used between peer DOS
workstations as well as OS/2 workstations and servers.
>
Modification Type: | Major | Last Reviewed: | 9/30/2003 |
---|
Keywords: | KB61797 |
---|
|