TCPMaid 2.0.4
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package TCPMaid --version 2.0.4
NuGet\Install-Package TCPMaid -Version 2.0.4
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TCPMaid" Version="2.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TCPMaid --version 2.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: TCPMaid, 2.0.4"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install TCPMaid as a Cake Addin #addin nuget:?package=TCPMaid&version=2.0.4 // Install TCPMaid as a Cake Tool #tool nuget:?package=TCPMaid&version=2.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
TCPMaid
An easy, powerful and lightweight TCP client/server in C#.
TCPMaid makes it easy to setup a robust client & server, send messages and requests, and provide your own SSL certificate.
Features
- Easy client & server setup
- Supports TCP and UDP
- Supports SSL encryption and certificates
- Automatically serialises messages
- Send requests and await a response
- Automatically fragments large messages
- Supports IPv4 and IPv6
Dependencies
Example
public static void Server() {
// Start server on port 5000
TCPMaidServer Server = new(5000);
Server.Start();
// Listen to connect event
Server.OnConnect += OnConnect;
Server.OnReceive += OnReceive;
// Events
void OnConnect(Connection Client) {
Console.WriteLine("Hi, client!");
}
void OnReceive(Connection Client, Message Message) {
if (Message is ExampleMessage ExampleMessage) {
Console.WriteLine($"Received '{ExampleMessage.ExampleText}' from client!");
}
}
}
public static async void Client() {
// Connect client to server
TCPMaidClient Client = new();
await Client.ConnectAsync("localhost", 5000);
// Say hello to server
await Client.Server!.SendAsync(new ExampleMessage("hello server!"));
}
public class ExampleMessage : Message {
[JsonProperty] public readonly string ExampleText;
public ExampleMessage(string example_text) {
ExampleText = example_text;
}
}
Output
Hi, client!
Received 'hello server!' from client!
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Newtonsoft.Json (>= 13.0.3)
-
net7.0
- Newtonsoft.Json (>= 13.0.3)
-
net8.0
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
3.0.0 | 84 | 12/7/2024 | |
2.4.1 | 150 | 4/13/2024 | |
2.4.0 | 110 | 3/31/2024 | |
2.3.0 | 107 | 3/30/2024 | |
2.2.0 | 118 | 3/29/2024 | |
2.1.1 | 131 | 3/17/2024 | |
2.1.0 | 130 | 3/7/2024 | |
2.0.4 | 137 | 3/3/2024 | |
1.0.7 | 119 | 2/22/2024 | |
1.0.6 | 127 | 2/20/2024 | |
1.0.5 | 140 | 2/18/2024 | |
1.0.4 | 145 | 2/17/2024 | |
1.0.3 | 138 | 2/7/2024 | |
1.0.2 | 132 | 2/5/2024 | |
1.0.1 | 126 | 1/22/2024 |