# TestClusterPortAllocator Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.testclusterportallocator/)

## AllocateConsecutivePortPairs(int) {#allocateconsecutiveportpairs-int-f7f95372}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.testclusterportallocator/methods/allocateconsecutiveportpairs-int-f7f95372/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.TestingHost/TestClusterPortAllocator.cs#L31-L37)

```csharp
public (int, int) TestClusterPortAllocator.AllocateConsecutivePortPairs(int numPorts = 5)
```

Allocates consecutive port pairs.

### Parameters

- `numPorts` (`int`): The number of consecutive ports to allocate.

### Returns

Base ports for silo and gateway endpoints.

## Dispose {#dispose-b484784c}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.testclusterportallocator/methods/dispose-b484784c/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.TestingHost/TestClusterPortAllocator.cs#L43-L45)

```csharp
public void Dispose()
```

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
