Newsgroups: bit.listserv.novell
Date:         Thu, 17 Dec 1992 18:15:27 EST
Reply-To:     Novell LAN Interest Group <NOVELL@SUVM.BITNET>
From:         Brett Warthen <BRETT@INFINITE.MHS.COMPUSERVE.COM>
Subject:      RE: Difference between Primary, Default, Preferred Servers

FORWARDED MESSAGE from Craig C. Tierney (MAIL @ CSERVE
CT> {INTERNET:CRAIG@agecon.wisc.edu}) at 12/17/92 2:03 PM
CT> From: "Craig C. Tierney" <CRAIG@agecon.wisc.edu>
CT> Subject:      Difference between Primary, Default, Preferred Servers
CT>
CT> I am trying to figure out exactly what the differences are between the
CT> Primary, Default and Preferred servers(In Connection/Workstation
CT> Services)?  I am trying to figure it out from Programmer's Guide to
CT> Netware and I am confused.

Yeah it is confusing.  It's too bad I waited to reply to this one until
after Charles Rose left, so I'd give him another chance to explain it a
little better here...<g>

Generally, the only server that you have to worry about is the preferred
server.  The primary and default servers come into play in the shell's
logic, for determining which server a request will be sent to if no
preferred server is set.

So...it works like this...

When you issue a bindery API call, if a preferred server is currently set,
then your call will be directed to that server.

If a preferred server is not currently set (as is normally the case if your
app doesn't set one)...then if your current default drive is a network
drive, then the API call is directed toward the server that this drive is
mapped to.  (Hence, this is called the default server.)

If your current drive is a local drive, then the API call is directed to
the primary server...which is usually the one that NETX connected to when
you first booted up.

CT>
CT> In my program, what bindery will my program be reading from if I begin
CT> to scan it?  If I want to scan a different bindery of a server I am
CT> already attached to, which value do I change(Primary, Default, or
CT> Preferred)?

You change the preferred server.  You'll probably never have a need to
change the primary server unless you are doing something real specialized.
The default server doesn't really apply here.

CT>
CT> Do I need to restore the values when I exit my program, or will it
CT> matter?
CT>
***** NOTES from Brett Warthen (BRETT @ INFINITE) at 12/17/92 4:30 PM
I make it a point to always save and restore the prefrerred connection when
complete.

Normally, when a program completes, the shell generates an EOJ and sets
back the preferred server...but in the more complex environments of today,
you never know...so it's a good idea to save & restore the preferred
connection.

And if you want to really have some fun...try maintaining a preferred
server in a Windows application...but we'll save that story for a different
day...

------------------------+-------------------------------------------------
 Brett Warthen          |        MHS:  Brett @ Infinite (via NHUB/CSERVE)
 Infinite Technologies  | CompuServe:  >MHS:Brett@Infinite
 11433 Cronridge Drive  |   Internet:  Brett@Infinite.mhs.compuserve.com
 Suite H                |       Phax:  +1-410-363-3779
 Owings Mills, MD 21117 |      Phone:  +1-410-363-1097
------------------------+-------------------------------------------------