DOFConfigBuildersetConnectionLimit Method OpenDOF Object Access Library
Sets the maximum number of simultaneous connections, both inbound and outbound, that a DOF can support.

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

C#
public DOFConfigBuilder setConnectionLimit(
	int limit
)

Parameters

limit
Type: SystemInt32
The connection limit that the DOF can support. This must be greater than or equal to zero.

Return Value

Type: DOFConfigBuilder
The Builder, with the maximum connections set to the new value.
Remarks

Sets the maximum number of simultaneous connections, both inbound and outbound, that a DOF can support. Inbound connections are those connected through all DOFServer instances on the node, although this parameter does not limit the number of servers you can create or start. Outbound connections are instances of DOFConnection for which you've called DOFConnection.connect(int) or DOFConnection.beginConnect(int) , although this parameter does not limit the number of connections you can create. In addition, only calls to connect or beginConnect that establish a new connection on the physical wire count toward the total--not calls for connections that have already been established. The sum of all inbound plus all outbound connections on the node must always be less than or equal to the value set for this parameter. If the node reaches its maximum, it will not allow you to initiate or accept new connections until some connections are dropped.

Inbound Type.DATAGRAM_STATELESS connections are not limited by this parameter, although outbound DATAGRAM_STATELESS connections do count toward the total.

If you input a value for the maximum number of connections that is greater than the limit the underlying operating system can handle, the number of connections you can initiate and accept will be constrained by the operating system. In addition, inputting DOF.UNLIMITED means that the library will not limit the maximum number of connections, but the operating system limits still apply.

By default, this parameter is set to DOF.UNLIMITED so that the operating system will manage the maximum number of connections. You would typically change this setting only for nodes with limited resources where you want to limit the connections to fewer than the operating system allows. If you enforce a limit, it should be carefully considered so that you do not prevent necessary connections.

See Also

Reference