# chronoxor/netcoreserver architecture

> Architecture diagram of the GitHub repository chronoxor/netcoreserver, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chronoxor/netcoreserver
- Repository: https://github.com/chronoxor/netcoreserver

## Overview

##### Main Components Overview

**[Core Components]**
- TCP Layer
- SSL Layer
- UDP Layer
- Unix Domain Socket Layer
- HTTP/HTTPS Layer
- WebSocket/WebSocket Secure Layer

**[Protocol Support]**
- Simple Protocol Handler
- Fast Binary Encoding Integration

**[Server Types]**
- Basic Servers (TCP/UDP/UDS)
- Secure Servers (SSL/TLS)
- Web Servers (HTTP/HTTPS)
- WebSocket Servers (WS/WSS)

**[Client Types]**
- Basic Clients (TCP/UDP/UDS)
- Secure Clients (SSL/TLS)
- Web Clients (HTTP/HTTPS)
- WebSocket Clients (WS/WSS)

##### Component Relationships

**a) Inheritance Relationships:**
- TcpServer → HttpServer → WsServer
- TcpServer → SslServer → HttpsServer → WssServer
- TcpClient → HttpClient → WsClient
- TcpClient → SslClient → HttpsClient → WssClient

**b) Communication Flows:**
- Server → Sessions (composition)

##### Detailed Components

**[Session Management]**
- TcpSession
- SslSession
- HttpSession
- WsSession
- UdsSession

**[Protocol Handlers]**
- HTTP Request/Response
- WebSocket Frames
- Protocol Buffers

**[Security]**
- SSL Context
- Certificates
- Authentication

##### Implementation Details

Notes for important implementation aspects:
**[Performance Features]**
- Asynchronous I/O
- Memory Buffer Management
- Connection Pooling
- 10K Problem Solution

**[Security Features]**
- SSL/TLS Support
- Certificate Management
- Secure Protocols

##### Additional Elements

Supporting information:
**[Configuration]**
- Server Settings
- Client Settings
- Protocol Settings

**[Utilities]**
- Buffer Management
- String Extensions
- File Cache

##### Notes

Important notes about:
- Cross-platform support
- Performance characteristics
- Security considerations
- Scalability features

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Core["Core Components"]
        TCP["TCP Layer"]:::core
        SSL["SSL Layer"]:::security
        UDP["UDP Layer"]:::core
        UDS["Unix Domain Socket Layer"]:::core
        HTTP["HTTP/HTTPS Layer"]:::web
        WS["WebSocket Layer"]:::web
    end

    subgraph Servers["Server Types"]
        direction TB
        TcpServer["TCP Server"]:::server
        SslServer["SSL Server"]:::server
        HttpServer["HTTP Server"]:::server
        HttpsServer["HTTPS Server"]:::server
        WsServer["WebSocket Server"]:::server
        WssServer["WebSocket Secure Server"]:::server
        UdpServer["UDP Server"]:::server
        UdsServer["UDS Server"]:::server
    end

    subgraph Clients["Client Types"]
        direction TB
        TcpClient["TCP Client"]:::client
        SslClient["SSL Client"]:::client
        HttpClient["HTTP Client"]:::client
        HttpsClient["HTTPS Client"]:::client
        WsClient["WebSocket Client"]:::client
        WssClient["WebSocket Secure Client"]:::client
        UdpClient["UDP Client"]:::client
        UdsClient["UDS Client"]:::client
    end

    subgraph Sessions["Session Management"]
        TcpSession["TCP Session"]:::session
        SslSession["SSL Session"]:::session
        HttpSession["HTTP Session"]:::session
        WsSession["WebSocket Session"]:::session
        UdsSession["UDS Session"]:::session
    end

    subgraph Protocol["Protocol Handlers"]
        HttpReq["HTTP Request"]:::protocol
        HttpRes["HTTP Response"]:::protocol
        WsFrames["WebSocket Frames"]:::protocol
        IWebSocket["IWebSocket Interface"]:::protocol
    end

    subgraph Security["Security Components"]
        SslContext["SSL Context"]:::security
        Certs["Certificates"]:::security
    end

    subgraph Utils["Utilities"]
        Buffer["Buffer Management"]:::util
        FileCache["File Cache"]:::util
        StringExt["String Extensions"]:::util
    end

    %% Inheritance Relationships
    TcpServer --> HttpServer --> WsServer
    TcpServer --> SslServer --> HttpsServer --> WssServer
    TcpClient --> HttpClient --> WsClient
    TcpClient --> SslClient --> HttpsClient --> WssClient

    %% Component Relationships
    TCP -.-> TcpServer & TcpClient
    SSL -.-> SslServer & SslClient
    UDP -.-> UdpServer & UdpClient
    UDS -.-> UdsServer & UdsClient
    HTTP -.-> HttpServer & HttpsServer
    WS -.-> WsServer & WssServer

    %% Session Relationships
    TcpServer --> TcpSession
    SslServer --> SslSession
    HttpServer --> HttpSession
    WsServer --> WsSession
    UdsServer --> UdsSession

    %% Protocol Handler Relationships
    HTTP --> HttpReq & HttpRes
    WS --> WsFrames & IWebSocket

    %% Security Relationships
    SSL --> SslContext
    SslContext --> Certs

    %% Click Events
    click TCP "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/TcpServer.cs"
    click SSL "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/SslServer.cs"
    click UDP "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/UdpServer.cs"
    click UDS "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/UdsServer.cs"
    click HTTP "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/HttpServer.cs"
    click WS "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/WebSocket.cs"
    click TcpServer "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/TcpServer.cs"
    click SslServer "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/SslServer.cs"
    click HttpServer "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/HttpServer.cs"
    click HttpsServer "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/HttpsServer.cs"
    click WsServer "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/WsServer.cs"
    click WssServer "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/WssServer.cs"
    click TcpClient "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/TcpClient.cs"
    click SslClient "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/SslClient.cs"
    click HttpClient "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/HttpClient.cs"
    click HttpsClient "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/HttpsClient.cs"
    click WsClient "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/WsClient.cs"
    click WssClient "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/WssClient.cs"
    click TcpSession "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/TcpSession.cs"
    click SslSession "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/SslSession.cs"
    click HttpSession "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/HttpSession.cs"
    click WsSession "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/WsSession.cs"
    click HttpReq "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/HttpRequest.cs"
    click HttpRes "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/HttpResponse.cs"
    click IWebSocket "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/IWebSocket.cs"
    click Buffer "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/Buffer.cs"
    click FileCache "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/FileCache.cs"
    click StringExt "https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/StringExtensions.cs"
    click Certs "https://github.com/chronoxor/NetCoreServer/tree/master/tools/certificates"

    classDef core fill:#2374ab
    classDef security fill:#57a773
    classDef web fill:#484d6d
    classDef server fill:#4392f1
    classDef client fill:#4392f1,stroke-dasharray: 5 5
    classDef session fill:#8c4843
    classDef protocol fill:#da4167
    classDef util fill:#b0b0b0
    classDef default fill:#ffffff,stroke:#000000,color:#000000
```
