GNOME Networking Idea

A number of people over the months have asked about network
transperancy in GNOME. After all, GNOME stands for GNU Network
Object Model, so I will tell you where the Network comes in. Network
Transparency means users and application programmers can access
files and resources from a remote machine in the same way they
might access local files. I will focus on the application side of
Network Transparency.

An application populates a URL structure. Using a Connection Object,
the application opens the URL. The Object Request Broker(ORB) that
owns the Connection Object will return a Location Object. We will
call this ORB the Network Connection Server or NCS.

The NCS is started from the command line. It creates a Connection
Object.  A string representation of the object is stored in an X
Server X_Atom called NCServerConnection. ORBs implementing the same
interface as the NCS, called Serverlets, for FTP, WWW, et al.
retrive this text and recreate the original Connection Object. They
create there own Connection Object called myConnection. They then
register their protocol and myConnection with the NCS using
``Register(NCS_Connection, myConnection, ``proto'').''

When the NCS receives an Open request from an application, it
interigates the protocol field of the URL and itself calls Open on
the appropriate Serverlet's myConnection Object sending the URL.
As much information about the URL as possible is stored in the
Location Object. The Serverlet then sends back the newly created
Location Object.

Applications can then do a number of things:

1. Read data from the resource pointed to by the Location.

2. Write data to the resource pointed to by the Location.

3. Set Metadata about the resource pointed to by the Location.

4. Delete the resource associated with the Location object.

5. Make a new Location object.

6. Get a list of Location objects inside the resource associated
with the Location.

We will focus on the 1, 2, and 6.

Read in the resource: The application calls the function
``Location_Read(loc, buf);.'' The Serverlet responsible for the
``loc'' instance of the Location Object reads in the network data
pointed to by the ``.resource'' member of the Location Object. It
then copies the data into the ``buf'' variable. The Serverlet
streams ``buf'' across the network to the application. All the data
from the remote resource will not always be read completely the
first time. The application must call ``Location_Read(loc, buf);''
until it returns a -1.

Write to the Resource: Before calling ``Location_Write(loc, buf);''
the application must populate the buf variable with data it wants
placed in the resource pointed to by the Location Object. The CORBA
stub streams out the data in ``buf'' and sends it to the Serverlet
controlling ``loc.'' This process can be repeated as many times as
the application wants, causing each successive ``Location_Write(loc,
buf);'' to append the data in ``buf'' to the resource.

Get a list of Resources: Calling ``Location_List(loc, loclist)''
causes the Serverlet to populate the ``loclist'' variable with
Location Objects pointing to resources located in the current
Location Object's resource member.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]