UCM Unitec Home Page
      

UCM Service Name

 Service(P)

Name   Environment   Usage   Description   Data Type   Remarks   See also

Name

Service

Environment

Windows

Usage

[Form.]Ucm.Service = value$

Description

The Service property is used to connect the control to a server process on a remote system. The value specified will be looked up in the UCM configuration section of the registry, which may be modified with the UcmConf(U) utility. Each service ID entry in the configuration file points to a host IP address and port number pair that identifies a TCP/IP connection. Once set, the Service property reduces the I/O scope to messages from the named service in the communication space CommID (and - as always - to messages with the same ID as defined by the InputID property). If Service is not set, messages from any source that match InputID will be received and output is forwarded to all UCM controls on the local system that have their Service, Host and Port properties cleared too.

The Service property is meaningful only with AdrMode set to ucmService.

Data Type

String

Remarks

The user of the UCM control does not have to call any TCP/IP functions. All communication tasks are handled by the Unitec Communication Manager Ucm.exe. For local communication the Service property should not be set.

The ‘>‘ character is interpreted as a special wildcard string terminator and causes UCM to automatically provide an unused Service from a Service group. Consider the situation where you want to allow the user to start multiple occurrences of a given program, each using the same remote server (Service). The Service table in the UCM configuration program should list a Service group, e.g.

Service Server IP Address
myserv1 aServer 128.41.2.1
myserv2 aServer 128.41.2.1
myserv3 aServer 128.41.2.1


In the Load event of the form containing the UCM control, you should then feed the Service property as follows:

On Error GoTo ErrorHandler

   Ucm1.Service = "myserv>"
   Exit Sub

ErrorHandler:
    MsgBox("You have already used all available communication lines.", _
           16, "AppName")
End

If no error occurs, an unused Service of myserv1, myserv2 or myserv3 has been reserved and assigned to the Service property.

Please note, that the wildcard service feature has become obsolete by the introduction of communication spaces in Release 2.0. It is maintained for compatibility and may be dropped in a future release.

As outlined in Chapter 1, Section 1.2 About UCM, any number of Ucm.ocx controls may be placed on a form. An application server typically handles requests of multiple controls on different forms, each of which has the same Service property value but different MessageID settings. The message dispatching algorithm is as follows:

A message sent by an UCM control through OutputMsg is forwarded to

  • the server identified by the Service value. (If no such connection exists, the communication manager UCM will create the socket and thus start the remote server).
  • any local UCM control with the proper InputID setting, when both the sending and the receiving control have their Service property not set. This may result in a broadcast type message, if more than one control have the same InputID value. If no such control exists on the local system and the AutoStart section created with UcmConf(U) defines a process for the given message ID, the named process is spawned, else the message is silently ignored.

A message sent by a remote server process is forwarded to any control that has the Service property set to the value that caused UCM to initialize the socket connection, and the InputID property set to the ID of the message. Again, this may result in a broadcast type message, if more than one control meet this condition. If no such control exists on the local system and the AutoStart section created with UcmConf(U) defines a process for the given message ID, the named process is spawned, else the message is silently ignored.

See also

AdrMode, CommID, DataInput(E), Host, InputMsg, InputID, OutputMsg, OutputID, Port

 

Back to top