来源信息
- 仓库
- pluginagentmarketplace/custom-plugin-server-side-game-dev
- 最近来源活动
- 2025年12月30日 11:46
- 检测到的 SKILL.md 语言
- 英语
- 星标
- 1
- 分支
- 1
安装方式
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
检查来源文件
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
菜单
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-server-side-game-dev --skill io-multiplexing命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | io-multiplexing |
| description | High-performance I/O multiplexing including epoll, IOCP, kqueue, and io_uring |
| sasmp_version | 1.3.0 |
| version | 2.0.0 |
| bonded_agent | 02-networking-specialist |
| bond_type | PRIMARY_BOND |
| parameters | {"required":["io_model"],"optional":["max_events","timeout_ms"],"validation":{"io_model":{"type":"string","enum":["epoll","iocp","kqueue","io_uring","select"]},"max_events":{"type":"integer","min":64,"max":10000,"default":1024},"timeout_ms":{"type":"integer","min":0,"max":1000,"default":16}}} |
| retry_config | {"max_attempts":1,"fallback":"blocking_io"} |
| observability | {"logging":{"level":"debug","fields":["events_count","wait_time_ms"]},"metrics":[{"name":"io_events_processed","type":"counter"},{"name":"io_wait_duration_ms","type":"histogram"}]} |
Implement high-performance I/O handling for thousands of concurrent connections.
| Model | Platform | Connections | Latency |
|---|---|---|---|
| epoll | Linux | 100K+ | Low |
| kqueue | BSD/macOS | 100K+ | Low |
| IOCP | Windows | 100K+ | Low |
| io_uring | Linux 5.1+ | 1M+ | Lowest |
| select | All | ~1000 | Medium |
#include <sys/epoll.h>
int epollfd = epoll_create1(0);
// Add socket
struct epoll_event ev;
ev.events = EPOLLIN | EPOLLET; // Edge-triggered
ev.data.fd = client_socket;
epoll_ctl(epollfd, EPOLL_CTL_ADD, client_socket, &ev);
// Event loop
struct epoll_event events[MAX_EVENTS];
while (running) {
int nfds = epoll_wait(epollfd, events, MAX_EVENTS, timeout_ms);
for (int i = 0; i < nfds; i++) {
if (events[i].events & EPOLLIN) handleRead(events[i].data.fd);
if (events[i].events & EPOLLOUT) handleWrite(events[i].data.fd);
}
}
#include <liburing.h>
struct io_uring ring;
io_uring_queue_init(, &ring, );
io_uring_get_sqe(&ring);
io_uring_prep_recv(sqe, socket_fd, buffer, BUFFER_SIZE, );
io_uring_sqe_set_data(sqe, &connection);
io_uring_submit(&ring);
io_uring_wait_cqe(&ring, &cqe);
Connection* conn = io_uring_cqe_get_data(cqe);
handleCompletion(conn, cqe->res);
io_uring_cqe_seen(&ring, cqe);
class GameServer {
int epollfd;
void run() {
while (running) {
pollEvents(16); // 16ms = 60 FPS budget
gameTick();
broadcastState();
}
}
void pollEvents(int timeout_ms) {
struct epoll_event events[1024];
int n = epoll_wait(epollfd, events, 1024, timeout_ms);
for (int i = 0; i < n; i++) {
handleEvent(events[i]);
}
}
};
| Error | Root Cause | Solution |
|---|---|---|
| EMFILE | Too many fds | Increase ulimit |
| Missed events | Level-triggered bug | Use edge-triggered |
| Starvation | Unbalanced load | Round-robin |
| High latency | Blocking call | Async everything |
# Check fd limits
ulimit -n
# Monitor fd usage
ls /proc/$(pgrep game-server)/fd | wc -l
# Check epoll stats
cat /proc/$(pgrep game-server)/fdinfo/3
TEST(EpollServer, HandlesMultipleConnections) {
EpollServer server(8080);
vector<TcpClient> clients(100);
for (auto& client : clients) {
client.connect("localhost", 8080);
}
EXPECT_EQ(server.connectionCount(), 100);
}
assets/ - I/O benchmarksreferences/ - Platform guides基于 SOC 职业分类