Click or drag to resize

NetworkControllerTestPort Method

Tests for an active port.

Namespace:  Xcalibur.Controllers
Assembly:  Xcalibur.Controllers (in Xcalibur.Controllers.dll) Version: 1.0.5.0 (1.0.0.0)
Syntax
public static bool TestPort(
	string machine,
	int port
)

Parameters

machine
Type: SystemString
The machine.
port
Type: SystemInt32
The port.

Return Value

Type: Boolean
Examples
C#
 1// Main
 2private static void Main()
 3{
 4    // Test RPC locally
 5    const int port = 135;
 6    var status = NetworkController.TestPort("localhost", port);
 7    var statusMessage = status ? "open" : "closed";
 8    Console.WriteLine($"Port {port} is {statusMessage}.");
 9
10    // Read
11    Console.Read();
12}
13
14// Result: Port 135 is open.
See Also