Opening the object server, Selecting a network interface, Opening the – Echelon LNS User Manual
Page 68: Selecting a, Network, Interface
LNS Programmer's Guide
54
Application Developer’s Kit CD-ROM jewel case. For more information on LNS licensing,
and for more details on the differences between Standard Mode and Demonstration
Mode, see Chapter 13, LNS Licensing.
Opening the Object Server
Once you have set the network access and license modes, you can open the Object Server,
as shown below:
ObjectServer.Open()
NOTE: If you will be opening any networks with an LNS application that is running as a
Windows service, then the first application to open the LNS Object Server must also be
running as a Windows service. In addition, if a network is to be opened by an LNS
application that is running as Windows service, then that network and system must be
opened by an LNS application that is running as Windows service before it is opened
with an LNS application running as a user process. For more information on this, consult
the help pages for the Open() methods of the Network and ObjectServer objects in
the LNS Object Server Reference help file.
Selecting a Network Interface
Local clients can access a record of the possible networks and servers from the LNS
global database. In contrast, each Full client application must register with the LNS
Server in order to interact with a network. Each Full client does so by querying the
L
ON
W
ORKS
network it’s attached to for available servers.
Each Full client applications must specify its network interface prior to having access to
the available servers and networks. You can do so by following these steps:
1. Fetch
the
NetworkInterfaces collection from the ObjectServer
object. All network interfaces registered in the Windows System Registry
on your application PC are automatically read by the Object Server, and
are included in this collection.
Dim NICollection as LcaNetworkInterfaces
Set NICollection = ObjectServer.NetworkInterfaces
2. Select the desired network interface. Remember that the
NetworkInterfaces collection contains all registered network
interfaces, including those that are not suitable for use with LNS.
NOTE: In LNS 3.0 and all subsequent releases, if multiple Full Client
applications on the same PC attempt to open the same network, they
must use the same network interface. Consider a case where you have
two PCLTA-20 network interface cards called LON1 and LON2 on a PC
that is running several Full client applications. If an application on that
PC opens a network using LON1, and then another application on the PC
attempts to open the same network using LON2, the second application
will receive the NS#149 lcaErrNsConflictWithCurrentNetwork
exception when it attempts to open the network. However, the second
application will be able to successfully open the network using LON1.
The following code selects a network interface named "LON1.”