CSDTP 0.1.1
dotnet add package CSDTP --version 0.1.1
NuGet\Install-Package CSDTP -Version 0.1.1
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="CSDTP" Version="0.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CSDTP --version 0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: CSDTP, 0.1.1"
#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 CSDTP as a Cake Addin
#addin nuget:?package=CSDTP&version=0.1.1
// Install CSDTP as a Cake Tool
#tool nuget:?package=CSDTP&version=0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Data Transfer Protocol for C#
Modern networking interfaces for C#.
Data Transfer Protocol
The Data Transfer Protocol (DTP) is a larger project to make ergonomic network programming available in any language. See the full project here.
Installation
Install the package:
$ nuget install CSDTP
Creating a server
A server can be built using the Server
implementation:
using CSDTP;
// Create a server that receives strings and returns the length of each string
public class MyServer : Server<int, string>
{
protected override void Receive(ulong clientId, string data)
{
// Send back the length of the string
Send(clientId, data.Length);
}
protected override void Connect(ulong clientId)
{
Console.WriteLine("Client with ID {0} connected", clientId);
}
protected override void Disconnect(ulong clientId)
{
Console.WriteLine("Client with ID {0} disconnected", clientId);
}
}
public class Main
{
public static void Main()
{
// Start the server
var server = new MyServer();
server.Start("127.0.0.1", 29275);
}
}
Creating a client
A client can be built using the Client
implementation:
using CSDTP;
// Create a client that sends a message to the server and receives the length of the message
public class MyClient : Client<string, int>
{
private readonly string _message;
public MyClient(string message)
{
_message = message;
}
protected override void Receive(int data)
{
// Validate the response
Console.WriteLine("Received response from server: {0}", data);
Assert.AreEqual(data, _message.Length);
}
protected override void Disconnected()
{
Console.WriteLine("Unexpectedly disconnected from server");
}
}
public class Main
{
public static void Main()
{
// Connect to the server
var message = "Hello, server!";
var client = new MyClient(message);
client.Connect("127.0.0.1", 29275);
// Send a message to the server
client.Send(message);
}
}
Security
Information security comes included. Every message sent over a network interface is encrypted with AES-256. Key exchanges are performed using a 2048-bit RSA key-pair.
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 was computed. 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 was computed. 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
- No dependencies.
GitHub repositories
This package is not used by any popular GitHub repositories.