SPEvaluatorModeProvisioning.GenerateUniquePort Method

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

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

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