https://github.com/murphsicles/tcp
@net/tcp — TCP networking for Zeta
https://github.com/murphsicles/tcp
Last synced: 22 days ago
JSON representation
@net/tcp — TCP networking for Zeta
- Host: GitHub
- URL: https://github.com/murphsicles/tcp
- Owner: murphsicles
- License: mit
- Created: 2026-06-07T01:27:35.000Z (about 2 months ago)
- Default Branch: master
- Last Pushed: 2026-06-07T02:38:44.000Z (about 2 months ago)
- Last Synced: 2026-06-07T03:40:52.113Z (about 2 months ago)
- Language: C
- Size: 2.93 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tcp — TCP networking for Zeta
**Namespace:** `@net/tcp`
TCP socket creation, binding, listening, and non-blocking configuration.
Async accept/connect/send/recv via `@io/uring` opcodes.
## Usage
```zeta
use net::tcp::{TcpSocket, AF_INET, SOCK_STREAM};
let sock: TcpSocket = TcpSocket_new();
TcpSocket_bind_v4(&sock, 8080, 0);
TcpSocket_listen(&sock, 128);
TcpSocket_set_nonblocking(&sock);
// Accept via io_uring SQE
// Connect via io_uring SQE
```
## API
| Function | Description |
|----------|-------------|
| `TcpSocket_new()` | Create a TCP socket |
| `TcpSocket_bind_v4(port, addr)` | Bind to IPv4 address |
| `TcpSocket_listen(backlog)` | Start listening |
| `TcpSocket_set_nonblocking()` | Enable non-blocking mode |
| `TcpSocket_close()` | Close the socket |
## Dependencies
- `@io/uring` — for async accept/connect/send/recv operations
## License
MIT — The Zeta Foundation