xyPortHelper 1.0.1
dotnet add package xyPortHelper --version 1.0.1
NuGet\Install-Package xyPortHelper -Version 1.0.1
<PackageReference Include="xyPortHelper" Version="1.0.1" />
<PackageVersion Include="xyPortHelper" Version="1.0.1" />
<PackageReference Include="xyPortHelper" />
paket add xyPortHelper --version 1.0.1
#r "nuget: xyPortHelper, 1.0.1"
#addin nuget:?package=xyPortHelper&version=1.0.1
#tool nuget:?package=xyPortHelper&version=1.0.1
xyPorts
xyPorts is a modular .NET library for managing, checking, and communicating over TCP and UDP ports. It offers simple wrapper classes for port analysis, message exchange, and listener control.
Table of Contents
Overview
This project was created to provide simple and reusable tools for working with TCP and UDP network ports. In addition to sending and receiving messages, it supports checking port availability and dynamically starting or stopping listeners.
Project Structure
xyPorts/
├── Basix/
│ ├── xyPort.cs
│ └── xyPortChecker.cs
├── TCP/
│ ├── xyTcpPort.cs
│ ├── xyTcpClient.cs
│ └── xyTcpListener.cs
├── UDP/
│ ├── xyUdpPort.cs
│ └── xyUdpClient.cs
└── Master/
└── xyPortManager.cs
Available Classes
Namespace: xyPorts.Basix
xyPort
Represents a generic port with properties likeIsListening
,IsExclusive
,PortID
, andInformation
.xyPortChecker
Provides methods to analyze open ports:GetOpenPorts()
IsPortAvaillable(int)
ArePortsAvaillable(List<int>)
Namespace: xyPorts.TCP
xyTcpPort
Specialized version ofxyPort
for TCP. IncludesTcpClient
,TcpListener
,xyTcpClient
,xyTcpListener
,ConnectionInformation
,Statistics
.xyTcpClient
Methods to establish a connection and send messages:ConnectTCP(string ip, ushort port, string message)
SendMsgTcp(...)
ReceiveResponseTCP(...)
xyTcpListener
Starts and manages TCP listeners:Listen(ushort port)
StopListeningTcp(ushort port)
SendConfirmationResponse(...)
ReceivedMessage
as EventHandler
Namespace: xyPorts.UDP
xyUdpPort
Specialized version ofxyPort
for UDP. IncludesUdpClient
,xyUdpClient
,UdpStatistics
,UdpReceiveResult
.xyUdpClient
Methods for UDP communication:ConnectUDP(string ip, ushort port, string message)
ReceiveDataUDP(...)
ClosePortUdp(...)
Namespace: xyPorts.Master
xyPortManager
Top-level class to manage and control ports.
Holds instances ofxyPort
,xyTcpPort
, andxyUdpPort
.
ProvidesClosePort(int port)
to kill the process using the port.
Usage
// Example: Check port availability
var checker = new xyPortChecker();
bool isFree = checker.IsPortAvaillable(13000);
// Open a TCP connection
xyTcpClient.ConnectTCP("127.0.0.1", 13000, "Hello TCP!");
// Send a UDP message
xyUdpClient.ConnectUDP("127.0.0.1", 12824, "Hello UDP!");
// Start a TCP listener
var listener = new xyTcpListener();
listener.Listen(13000);
Dependencies
- .NET Standard / .NET Core
xyToolz
(for utilities like logging)System.Net
,System.Net.Sockets
Microsoft.Extensions.Logging
License
This project is licensed under the GNU General Public License v3.0 (GPLv3).
See the LICENSE file for more information.
Author
Project by ThrashingLaggard Part of
xyToolz
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.VisualStudio.Azure.Containers.Tools.Targets (>= 1.21.0)
- xyToolz (>= 1.0.32)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.