TestimoX

API Reference

Class

PortTester

Namespace ADPlayground.Network
Assembly ADPlayground
Modifiers sealed

Provides methods for testing TCP and UDP ports.

Inheritance

  • Object
  • PortTester

Constructors

public PortTester() #

Methods

public IReadOnlyList<PortTestResult> TestServer(String computerName, IEnumerable<Int32> portTcp = null, IEnumerable<Int32> portUdp = null, Int32 retryCount = 1, Int32 retryDelayMs = 100, Int32 timeoutMs = 1000, Boolean udpRequireResponse = false, Byte[] udpPayload = null, CancellationToken cancellationToken = null) #
Returns: IReadOnlyList<PortTestResult>

Tests ports on a single computer.

Parameters

computerName System.String requiredposition: 0
Target computer name or IP.
portTcp System.Collections.Generic.IEnumerable{System.Int32} = null optionalposition: 1
Collection of TCP ports to test.
portUdp System.Collections.Generic.IEnumerable{System.Int32} = null optionalposition: 2
Collection of UDP ports to test.
retryCount System.Int32 = 1 optionalposition: 3
Number of retry attempts per port.
retryDelayMs System.Int32 = 100 optionalposition: 4
Delay between retries in milliseconds.
timeoutMs System.Int32 = 1000 optionalposition: 5
Connection timeout in milliseconds.
udpRequireResponse System.Boolean = false optionalposition: 6
When true, UDP tests expect a response which may fail for services that do not reply.
udpPayload System.Byte[] = null optionalposition: 7
Optional payload sent during UDP tests. If , an empty datagram is used.
cancellationToken System.Threading.CancellationToken = null optionalposition: 8
Cancellation token.

Exceptions

  • ArgumentException – Thrown when udpPayload exceeds 65507 bytes.
public async Task<IReadOnlyList<PortTestResult>> TestServerAsync(String computerName, IEnumerable<Int32> portTcp = null, IEnumerable<Int32> portUdp = null, Int32 retryCount = 1, Int32 retryDelayMs = 100, Int32 timeoutMs = 1000, Boolean udpRequireResponse = false, Byte[] udpPayload = null, CancellationToken cancellationToken = null) #
Returns: Task<IReadOnlyList<PortTestResult>>

Tests ports on a single computer.

Parameters

computerName System.String requiredposition: 0
Target computer name or IP.
portTcp System.Collections.Generic.IEnumerable{System.Int32} = null optionalposition: 1
Collection of TCP ports to test.
portUdp System.Collections.Generic.IEnumerable{System.Int32} = null optionalposition: 2
Collection of UDP ports to test.
retryCount System.Int32 = 1 optionalposition: 3
Number of retry attempts per port.
retryDelayMs System.Int32 = 100 optionalposition: 4
Delay between retries in milliseconds.
timeoutMs System.Int32 = 1000 optionalposition: 5
Connection timeout in milliseconds.
udpRequireResponse System.Boolean = false optionalposition: 6
When true, UDP tests expect a response which may fail for services that do not reply.
udpPayload System.Byte[] = null optionalposition: 7
Optional payload sent during UDP tests. If , an empty datagram is used.
cancellationToken System.Threading.CancellationToken = null optionalposition: 8
Cancellation token.

Exceptions

  • ArgumentException – Thrown when udpPayload exceeds 65507 bytes.