https://github.com/skullchap/fnet
fnet - FILE* over your socks. Easily create and handle your network sockets.
https://github.com/skullchap/fnet
c network sockets tcp udp unix
Last synced: over 1 year ago
JSON representation
fnet - FILE* over your socks. Easily create and handle your network sockets.
- Host: GitHub
- URL: https://github.com/skullchap/fnet
- Owner: skullchap
- Created: 2025-03-11T17:21:41.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-13T09:48:55.000Z (over 1 year ago)
- Last Synced: 2025-03-13T10:35:16.082Z (over 1 year ago)
- Topics: c, network, sockets, tcp, udp, unix
- Language: C
- Homepage:
- Size: 30.3 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fnet - FILE* over your socks.
#### Create, send and receive data over your tcp, udp and unix sockets with familiar C standard library FILE* IO interface.
```c
NetConn *c = fnetdial("tcp", "127.0.0.1:9999");
fprintf(fnetf(c), "hello!\n");
```
#### Dial/Listen should be familiar to Plan9'ers and Gophers.
```c
NetConn* fnetdial(char *proto, char *addr);
NetConn* fnetlisten(char *proto, char *addr);
NetConn* fnetaccept(NetConn*);
char* fneterr(void);
FILE* fnetf(NetConn*);
char* fnetlocaddr(NetConn*);
char* fnetremaddr(NetConn*);
void fnetclose(NetConn*);
```
#### Check examples of dialing and listening.
```bash
cd examples/
./compile dial && ./compile listen
# ./listen tcp 127.0.0.1:9999 # ./dial tcp 127.0.0.1:9999
```
## License
MIT