# dpull/skynet-mingw architecture

> Architecture diagram of the GitHub repository dpull/skynet-mingw, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dpull/skynet-mingw
- Repository: https://github.com/dpull/skynet-mingw

## Overview

skynet-mingw is a Windows compatibility layer for the Skynet runtime, adapting its polling, socket, and POSIX-like platform interfaces to Windows. The documented user workflow is to launch a Skynet node (and master) with a configuration, then connect a client. The excerpts show the Windows poll adapter delegating to its epoll-compatible implementation and platform initialization managing that implementation’s startup and cleanup. The Skynet submodule’s internals were not sampled, so its runtime integration is not traced here.

Main entry points: [`platform/platform.h`](https://github.com/dpull/skynet-mingw/blob/master/platform/platform.h) (Platform API), [`skynet`](https://github.com/dpull/skynet-mingw/tree/master/skynet) (Skynet Runtime), [`platform/epoll.c`](https://github.com/dpull/skynet-mingw/blob/master/platform/epoll.c) (Windows Epoll), [`platform/socket_poll.c`](https://github.com/dpull/skynet-mingw/blob/master/platform/socket_poll.c) (Socket Poll Adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Skynet Runtime"]
  node_skynet["Skynet Runtime"]
end

subgraph group_events["Event Polling"]
  node_poll["Socket Poll Adapter<br/>[socket_poll.c]"]
  node_epoll["Windows Epoll<br/>[epoll.c]"]
end

subgraph group_compat["Platform Compatibility"]
  node_platform_api["Platform API<br/>[platform.h]"]
  node_os_compat["POSIX Compatibility<br/>[platform.c]"]
  node_socket_compat["Socket Extensions<br/>[socket_extend.c]"]
  node_winsock_defs["Winsock Definitions<br/>[socket.h]"]
end

node_operator(("Operator"))
node_client(("Client"))

node_operator -->|"launches node"| node_skynet
node_client -->|"connects to"| node_skynet
node_poll -->|"delegates polling"| node_epoll
node_os_compat -->|"starts and cleans up"| node_epoll
node_socket_compat -->|"implements extensions"| node_platform_api
node_platform_api -->|"includes definitions"| node_winsock_defs

click node_skynet "https://github.com/dpull/skynet-mingw/tree/master/skynet"
click node_poll "https://github.com/dpull/skynet-mingw/blob/master/platform/socket_poll.c"
click node_epoll "https://github.com/dpull/skynet-mingw/blob/master/platform/epoll.c"
click node_platform_api "https://github.com/dpull/skynet-mingw/blob/master/platform/platform.h"
click node_os_compat "https://github.com/dpull/skynet-mingw/blob/master/platform/platform.c"
click node_socket_compat "https://github.com/dpull/skynet-mingw/blob/master/platform/socket_extend.c"
click node_winsock_defs "https://github.com/dpull/skynet-mingw/blob/master/platform/sys/socket.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_skynet,node_client toneBlue
class node_poll,node_epoll toneAmber
class node_platform_api,node_os_compat,node_socket_compat,node_winsock_defs toneMint
class node_operator toneIndigo
```

## Components

### Skynet Runtime

- [Skynet Runtime](https://github.com/dpull/skynet-mingw/tree/master/skynet): `skynet`

### Event Polling

- [Socket Poll Adapter](https://github.com/dpull/skynet-mingw/blob/master/platform/socket_poll.c): `platform/socket_poll.c`
- [Windows Epoll](https://github.com/dpull/skynet-mingw/blob/master/platform/epoll.c): `platform/epoll.c`

### Platform Compatibility

- [Platform API](https://github.com/dpull/skynet-mingw/blob/master/platform/platform.h): `platform/platform.h`
- [POSIX Compatibility](https://github.com/dpull/skynet-mingw/blob/master/platform/platform.c): `platform/platform.c`
- [Socket Extensions](https://github.com/dpull/skynet-mingw/blob/master/platform/socket_extend.c): `platform/socket_extend.c`
- [Winsock Definitions](https://github.com/dpull/skynet-mingw/blob/master/platform/sys/socket.h): `platform/sys/socket.h`

### Other components

- **Operator**
- **Client**

## Connections

- Operator → Skynet Runtime: launches node (evidence: `README.md`)
- Client → Skynet Runtime: connects to (evidence: `README.md`)
- Socket Poll Adapter → Windows Epoll: delegates polling (evidence: `platform/socket_poll.c`)
- POSIX Compatibility → Windows Epoll: starts and cleans up (evidence: `platform/platform.c`)
- Socket Extensions → Platform API: implements extensions (evidence: `platform/socket_extend.c`)
- Platform API → Winsock Definitions: includes definitions (evidence: `platform/platform.h`)
