Share via


SPEvaluatorModeProvisioning.GenerateUniquePort method

Returns the number of a port that is not in use.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Function GenerateUniquePort ( _
    maxTries As Integer, _
    minimumPort As Integer, _
    maximumPort As Integer _
) As Integer
'Usage
Dim instance As SPEvaluatorModeProvisioning
Dim maxTries As Integer
Dim minimumPort As Integer
Dim maximumPort As Integer
Dim returnValue As Integer

returnValue = instance.GenerateUniquePort(maxTries, _
    minimumPort, maximumPort)
public int GenerateUniquePort(
    int maxTries,
    int minimumPort,
    int maximumPort
)

Parameters

  • maxTries
    Type: System.Int32

    A 32-bit integer that specifies the number of attempts to discover a free port.

  • minimumPort
    Type: System.Int32

    A 32-bit integer that specifies the minimum port number.

  • maximumPort
    Type: System.Int32

    A 32-bit integer that specifies the maximum port number.

Return value

Type: System.Int32
Returns the number of the unused port.

Remarks

The GenerateUniquePort method returns a FileNotFound exception if an unused port cannot be found.

See also

Reference

SPEvaluatorModeProvisioning class

SPEvaluatorModeProvisioning members

Microsoft.SharePoint namespace