UCM Unitec Home Page
      

UCM Communication Space

 CommID(P)

Name   Environment   Usage   Description   Data Type   Remarks   See also

Name

CommID

Environment

Windows

Usage

[Form.]Ucm.CommID = value&

Description

The CommID property identifies the communication space the control and the underlying TCP/IP socket is a member of. All message IO is done within the defined space, i.e. communication data can not cross space boundaries. The main purpose of the CommID property is to allow multiple instances of a client program, each communicating to its own server thread or process.

This additional addressing level has been introduced starting with UCM Release 2.0. It is identified by a long integer. Each control belongs to a communication space, by default to ID 0 (zero). Also each socket created by the client side communication manager Ucm.exe(U), belongs to a communication space, namely to the space of the control, that caused the socket to be established. Again, input messages are never distributed across communication space boundaries. Since only one connection to a given address may exist in each space, all controls referring the same TCP address and CommID share one single connection. In local communication, the CommID of the sending control identifies the target space. It is important to note, that communication spaces are system local entities. The server does not need to know to which space the other end of the socket belongs to. The CommID property should be set prior to the first output operation. A perfect value is the ID of the main thread of a process (i.e. App.ThreadID), since it is guaranteed to be unique.

The global communication space is identified by ID 0 (zero). Unbound controls will receive input messages from any space when their InputID matches the ID of the message to be distributed.

Data Type

Long

Remarks

The default setting of CommID is 0 (zero).

Although making little sense it is possible to change the CommID of a control at runtime. If in the new space no socket with the same address already exists, the space membership of the existing socket is changed to the new ID. If such a socket already exists, the control is attached to it and the connection in the old space is dropped.

Important note:

If two controls in the same process refer to the same TCP address but have distinct CommID settings, each of the controls communicate with a separate server tread or process. Since this is not what is normally wanted, all CommIDs in a single program should be set to the same value.

See also

Host, Port, Service, Chapter 5  Active-X Introduction

 

Back to top