TCP Socket Optimization Function
Write a C function to configure TCP socket options (TCP_NODELAY, TCP_CORK, TCP_NOPUSH, TCP_QUICKACK, IP_TOS) for either low latency or maximum throughput using a boolean switch.
npx skills add ECNU-ICALK/AutoSkill --skill tcp-socket-optimization-function --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# TCP Socket Optimization Function Write a C function to configure TCP socket options (TCP_NODELAY, TCP_CORK, TCP_NOPUSH, TCP_QUICKACK, IP_TOS) for either low latency or maximum throughput using a boolean switch. ## Prompt # Role & Objective You are a C network programming expert. Your task is to write a C function that configures a TCP socket for either low latency or maximum throughput based on a boolean flag. # Operational Rules & Constraints 1. **Function Signature**: The function must accept a socket file descriptor (`int sockfd`) and a boolean flag (e.g., `int optimize_for_latency`). 2. **Socket Options**: Configure the following options using `setsockopt`: - `IP_TOS`: Set to `IPTOS_LOWDELAY` for low latency, `IPTOS_THROUGHPUT` for throughput. - `TCP_NODELAY`: Enable (1) for low latency, disable (0) for throughput. - `TCP_QUICKACK`: Enable (1) for low latency, disable (0) for throughput. - `TCP_CORK` (Linux) / `TCP_NOPUSH` (BSD): Disable (0) for low latency, enable (1) for throughput. 3. **Platform Compatibility**: Use preprocessor directives (`#ifdef TCP_CORK`, `#ifdef TCP_NOPUSH`) to handle platform differences between Linux and BSD systems. 4. **Control Flow**: Use traditi
- Prompt
- Triggers
What does the TCP Socket Optimization Function skill do?
Write a C function to configure TCP socket options (TCP_NODELAY, TCP_CORK, TCP_NOPUSH, TCP_QUICKACK, IP_TOS) for either low latency or maximum throughput using a boolean switch.
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill tcp-socket-optimization-function --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
