Back Previous Next


Linguist network package - set

Syntax:

   set the url of {connection} to {url}
   set property {name} of {connection} to {value}
   set the mode of {connection } to get/post
   set the mode of {socket} to multicast/server
   set the address of {socket} to {address}
   set the port of {socket} to {port}
   set the source of {message} to {module}
   set the destination of {message} to {module}/service {n} of {client}
   set the destination of {message} to the sender
   set the destination of {message} to {name} {address}
   set the text of {message} to {text}
   set the network name to {name}
   set {client} to report if no services

Keyword handler:

   net.eclecity.linguist.network.keyword.NetworkKSet.class

Runtime handler(s):

   net.eclecity.linguist.network.handler.NetworkHSet.class
   net.eclecity.linguist.network.handler.NetworkHDoNetworker.class

Function:

The first form registers a URL with a connection variable. This is the server that will be called when the connection is used.

The second form sets a specific property of a connection to a value. This will send the property, with its name, to the server as an HTTP parameter when the connection is used.

The third form sets the mode of the connection.

set the mode of {socket}
determines how the socket will be used. By default it is a simple client socket; using this command it can be set up as a multicast or a server socket.

set the port of {socket}
assigns a port number to the socket.

set the source of {message} to {module} attaches the named client or service to the message, so that the recipient of a message will know who it came from. [In any case, message variables know nothing about networking; they need a client or service to do the actual transmission.]

set the destination of {message} enables you to state where the message will be sent to. There are three options. First, a client can extract the identity of a service from the information contained in its notification callback. Second, you can attach the sender of the latest message (this must be done inside an on tell or on ask callback). Thirdly, you can identify a destination explicitly by giving its name and URL (or IP address).

set the text of {message} to {text} enables you to attach a message string to a message. If you are using ask this is the only way to do it, but if using send you can put the text into that command.

set the network name to {name} enables you to specify a network name for this computer for use in peer-to-peer networking. A default name will already have been chosen by the system, so there is little need to change it.

set {client} to report if no services changes the default behaviour when new services are announced. By default, a client only receives a notification if there are services available of the same type as itself. There are circumstances, however, when you may need to know that a previously-present service is no longer there; this command will cause all changes to the overall configuration to result in a notification, even if there are no services of the appropriate type.

Example(s):

   set the url of MyCOnnection to "http://www.gt-computing.co.uk"
   set property "action" of MyConnection to "GetCustomers"
   set the mode of MyConnection to post
   set the mode of ServerSocket to server
   set the address of MySocket to "192.168.0.15"
   set the port of MySocket to 12345
   set the source of AdminMessage to AdminServer
   set the destination of AdminMessage to service 0 of AdminClient
   set the destination of ClockMessage to the sender
   set the destination of MyMessage to "InfoService" "192.168.2.24"
   set the network name to "MAINPC"
   set ClockClient to report if no services


Back Previous Next KQUOTE>