DOFcreateConnection Method OpenDOF Object Access Library
Creates a DOFConnection that uses the specified configuration. The connection is associated with the DOF instance that creates it, and only that DOF can route operations through it (see DOF).

This method may be used to create the following types of connections:

  • Type.STREAM
  • Type.DATAGRAM
  • Type.DATAGRAM_STATELESS
This method may not be used to create the following types of connections:
  • Type.GROUP . Use DOFServer.createConnection(Config) .
  • Type.HUB . Use DOFServer.createConnection(Config) .
  • Type.POINT . Use DOFConnection.createConnection(Config)
For more information about these connection types, see Type .

Connections do not connect automatically when created. After creating the connection, call DOFConnection.connect(int) or DOFConnection.beginConnect(int) . To disconnect temporarily, call DOFConnection.disconnect() . Disconnected connections can be reconnected using DOFConnection.connect or DOFConnection.beginConnect. When the DOFConnection instance is no longer needed, it must be destroyed. See DOFConnection.destroy() and destroy() . Destroyed connections cannot be reconnected.

The internal library tracks references to duplicate connections, so this method can safely be called multiple times with the same configuration without consuming extra resources. Such duplicate connections are frequently needed, especially by nodes that create connections dynamically in response to other method calls.

Namespace: org.opendof.core.oal
Assembly: dof-oal (in dof-oal.dll) Version: 7.0.1.2
Syntax

C#
public DOFConnection createConnection(
	DOFConnectionConfig config
)

Parameters

config
Type: org.opendof.core.oalDOFConnectionConfig
An instance of Config that represents a source of configuration parameters for the DOFConnection. Use Builder to create an instance of DOFConnection.Config. This must not be null.

Return Value

Type: DOFConnection
A new instance of DOFConnection. The return value will be null if the configuration is invalid or if the DOF cannot accept the new DOFConnection.
See Also

Reference

Control.setTargetConnection(DOFConnection)