# TestClusterPortAllocator

Package: [Microsoft.Orleans.TestingHost](/orleans/docs/api/csharp/microsoft.orleans.testinghost/) 10.0.0

[NuGet package](https://www.nuget.org/packages/Microsoft.Orleans.TestingHost) | [Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.TestingHost/TestClusterPortAllocator.cs#L17)

```csharp
public class TestClusterPortAllocator : ITestClusterPortAllocator, IDisposable
```

Default [ITestClusterPortAllocator](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.itestclusterportallocator/) implementation, which tries to allocate unused ports.

## Constructors

- [TestClusterPortAllocator](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.testclusterportallocator/constructors/constructor-b2242a51/)

## Methods

- [AllocateConsecutivePortPairs(int)](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.testclusterportallocator/methods/allocateconsecutiveportpairs-int-f7f95372/)
- [Dispose](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.testclusterportallocator/methods/dispose-b484784c/)
