Logo Search packages:      
Sourcecode: r-cran-nws version File versions  Download package

def nwsclient::NetWorkSpace::__init__ (   self,
  wsName = '__default',
  serverHost = 'localhost',
  serverPort = 8765,
  useUse = False,
  server = None,
  opt 
)

Construct a NetWorkSpace object for the specified NwsServer.

Arguments:

wsName -- Name of the workspace.  There can only be one
workspace on the server with a given name, so two
clients can easily communicate with each other by both
creating a NetWorkSpace object with the same name on the
same server.  The first client that creates a workspace
that is willing to take ownership of it, will become the
owner (see the description of the useUse argument below
for more information on workspace ownership).

serverHost -- Host name of the NWS server.  This argument is
ignored if the server argument is not None.  The default
value is 'localhost'.

serverPort -- Port of the NWS server.  This argument is ignored
if the server argument is not None.  The default value
is 8765.

useUse -- Boolean value indicating whether you only want to use
this workspace, or if you want to open it (which means
you're willing to take ownership of it, if it's not
already owned).  

The default value is False, meaning you are willing to
take ownership of this workspace.

server -- NwsServer object to associate with this object.  If
the value is None (the default value), then a NwsServer
object will be constructed, using the host and port
specified with the serverHost and serverPort arguments.

The default value is None.

Keyword Arguments:

persistent -- Boolean value indicating whether the workspace
should be persistent or not.  If a workspace is
persistent, it won't be purged when the owner
disconnects from the NWS server.  Note that only the
client who actually takes ownership of the workspace
can make the workspace persistent.  The persistent
argument is effectively ignored if useUse is True, since
that client never becomes the owner of the workspace.
If useUse is False, it is the client who actually
becomes the owner that determines whether it is
persistent or not.  That is, after the workspace is
owned, the persistent argument is ignored.  The default
value is false.

create -- Boolean value indicating whether the workspace should
be created if it doesn't already exist.  The default
value is true.

Definition at line 505 of file nwsclient.py.

00505                                                                                                                      :
        """Construct a NetWorkSpace object for the specified NwsServer.

        Arguments:

        wsName -- Name of the workspace.  There can only be one
                workspace on the server with a given name, so two
                clients can easily communicate with each other by both
                creating a NetWorkSpace object with the same name on the
                same server.  The first client that creates a workspace
                that is willing to take ownership of it, will become the
                owner (see the description of the useUse argument below
                for more information on workspace ownership).

        serverHost -- Host name of the NWS server.  This argument is
                ignored if the server argument is not None.  The default
                value is 'localhost'.

        serverPort -- Port of the NWS server.  This argument is ignored
                if the server argument is not None.  The default value
                is 8765.

        useUse -- Boolean value indicating whether you only want to use
                this workspace, or if you want to open it (which means
                you're willing to take ownership of it, if it's not
                already owned).  

                The default value is False, meaning you are willing to
                take ownership of this workspace.

        server -- NwsServer object to associate with this object.  If
                the value is None (the default value), then a NwsServer
                object will be constructed, using the host and port
                specified with the serverHost and serverPort arguments.

                The default value is None.

        Keyword Arguments:

        persistent -- Boolean value indicating whether the workspace
                should be persistent or not.  If a workspace is
                persistent, it won't be purged when the owner
                disconnects from the NWS server.  Note that only the
                client who actually takes ownership of the workspace
                can make the workspace persistent.  The persistent
                argument is effectively ignored if useUse is True, since
                that client never becomes the owner of the workspace.
                If useUse is False, it is the client who actually
                becomes the owner that determines whether it is
                persistent or not.  That is, after the workspace is
                owned, the persistent argument is ignored.  The default
                value is false.

        create -- Boolean value indicating whether the workspace should
                be created if it doesn't already exist.  The default
                value is true.

        """
        if type(wsName) != str:
            raise TypeError, 'workspace name must be a string'

        self.curWs = wsName

        # if invoked (indirectly) via a NwsServer openWs or useWs method,
        # the server will be passed in and used. if invoked directly,
        # need to create a new NwsServer instance.
        if not server:
            self.server = NwsServer(serverHost, serverPort)
            # now give the server a chance to do its thing.
            try:
                if useUse:
                    self.server.useWs(wsName, self, **opt)
                else:
                    self.server.openWs(wsName, self, **opt)
            except Exception, e:
                # close the server and re-raise the exception
                try: self.server.close()
                except: pass
                raise e
        else:
            self.server = server

        self.send = self.server._sendAll
        self.recv = self.server._recvN

    def __str__(self):


Generated by  Doxygen 1.6.0   Back to index