2023-04-21 00:43:26 +03:00
|
|
|
### Socket and networking for Linux, BSDs, macOS and Windows
|
2021-02-04 11:17:43 +03:00
|
|
|
|
2021-02-07 22:31:04 +03:00
|
|
|
### Overview
|
2021-02-04 11:17:43 +03:00
|
|
|
|
|
|
|
- Includes three implementations :
|
|
|
|
|
2023-03-19 21:53:57 +03:00
|
|
|
| Implementation | Description |
|
|
|
|
|------------------|-----------------------------------------------------------|
|
|
|
|
| sc_sock_xxx | TCP socket wrapper for blocking and nonblocking sockets |
|
|
|
|
| sc_sock_poll_xxx | Epoll / Kqueue / WSAPoll wrapper |
|
|
|
|
| sc_sock_pipe_xxx | Unix pipe() and an equivalent implementation for Windows. |
|
2021-02-04 11:17:43 +03:00
|
|
|
|
|
|
|
|
|
|
|
- Works for IPv4, IPv6 and Unix domain sockets. (~ Windows 10 2018 added Unix
|
|
|
|
domain sockets support.)
|
|
|
|
- No UDP support.
|
|
|
|
- Works for blocking and nonblocking sockets.
|
|
|
|
|
|
|
|
|
2021-02-07 22:31:04 +03:00
|
|
|
### Usage
|
2021-02-04 11:17:43 +03:00
|
|
|
|
|
|
|
This is not an "easy to use" implementation. It just provides wrappers to
|
|
|
|
provide portability between operating systems. So, you're expected to know what
|
|
|
|
you're doing. (familiar with sockets API and know how to use it). Please take
|
2021-02-05 16:35:10 +03:00
|
|
|
a look at the code and grab pieces you want. Hopefully, I will add an example
|
|
|
|
soon.
|