XmobiTea.ProtonNet.Server.Socket 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package XmobiTea.ProtonNet.Server.Socket --version 1.0.3                
NuGet\Install-Package XmobiTea.ProtonNet.Server.Socket -Version 1.0.3                
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="XmobiTea.ProtonNet.Server.Socket" Version="1.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add XmobiTea.ProtonNet.Server.Socket --version 1.0.3                
#r "nuget: XmobiTea.ProtonNet.Server.Socket, 1.0.3"                
#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 XmobiTea.ProtonNet.Server.Socket as a Cake Addin
#addin nuget:?package=XmobiTea.ProtonNet.Server.Socket&version=1.0.3

// Install XmobiTea.ProtonNet.Server.Socket as a Cake Tool
#tool nuget:?package=XmobiTea.ProtonNet.Server.Socket&version=1.0.3                

XmobiTea.ProtonNet.Server.Socket

Installation Instructions

To install XmobiTea.ProtonNet.Server.Socket, clone the repository and include the project in your solution.

git clone https://github.com/your-repository/XmobiTea.ProtonNet.Server.Socket.git

Ensure all dependencies are restored before building the project.

Features

  • Socket Server Implementation: Provides a robust and scalable socket server framework.
  • Supports Multiple Protocols: Handles TCP, UDP, WebSocket, SSL/TLS, and more.
  • Customizable Controllers: Extend and customize socket controllers to handle specific protocol logic.
  • Session Management: Efficient session handling with timeout and disconnect logic.
  • Security: Supports encryption and secure communication channels.
  • Event-Driven Architecture: Handles socket events such as connection, disconnection, data reception, and errors.

Usage Examples

Example 1: Creating a Basic Socket Server

var startupSettings = StartupSettings.NewBuilder()
    .SetName("MySocketServer")
    .SetTcpServer(TcpServerSettings.NewBuilder()
        .SetEnable(true)
        .SetAddress("127.0.0.1")
        .SetPort(8080)
        .Build())
    .Build();

var socketServer = new SocketServer(startupSettings);
socketServer.Start();

Example 2: Handling Received Data

public class CustomSocketController : SocketController
{
    public override void OnReceived(ISocketSession session, byte[] buffer, int position, int length)
    {
        var data = Encoding.UTF8.GetString(buffer, position, length);
        Console.WriteLine($"Received data: {data}");
    }
}

Supported Data Types

  • byte[]: For binary data transmission.
  • string: For text data transmission, typically UTF-8 encoded.
  • Custom Protocol Messages: Serialize and deserialize custom protocol messages using the provided interfaces.

Extensibility

  • Custom Controllers: Inherit from SocketController to define your own behavior for handling connections, data, and errors.
  • Operation Model Handlers: Create handlers by inheriting from AbstractOperationModelHandler to process specific operations.
  • Session Services: Implement custom session services by extending ISessionService.

Contributing Guidelines

Contributions are welcome! Please fork the repository and submit a pull request with your changes. Ensure all tests pass and follow the coding conventions used in the project.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgments

Special thanks to the XmobiTea community for their continuous support and contributions.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  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 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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net46 is compatible.  net461 is compatible.  net462 is compatible.  net463 was computed.  net47 is compatible.  net471 is compatible.  net472 is compatible.  net48 is compatible.  net481 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.