2022-10-02 22:26:07 +07:00
# Kernel Queue (kqueue) Utilization
2022-09-22 23:41:38 +07:00
This is your lame attempt to understand how those Network Virtual Functions sofware works as well to sharpen your understanding on C++ and C programming language.
2022-10-02 22:26:07 +07:00
## Why not [epoll]() or [select]()
Using epoll or select would make your system spend most of its time looking at and fiddling sith the data structures and has very little time for anything else.
## Notes
2022-09-22 23:41:38 +07:00
2022-09-25 20:15:32 +07:00
- Compile using `g++` for the file watcher
To trace the function calls on FreeBSD based system use `truss()` instead of `strace` .
The `kqueue_socket.c` is my attempt on create a socket watcher timer program using `kevent` .
2022-09-25 20:16:54 +07:00
- [KQUEUE NETBSD GUIDE ](https://wiki.netbsd.org/tutorials/kqueue_tutorial/ )
2022-09-25 20:15:32 +07:00
2022-10-02 22:26:07 +07:00
```C
// --------------------------------------------
2022-09-25 20:15:32 +07:00
struct kevent my_event;
struct kevent my_change;
EV_SET(&my_change, ...); // Initialize the kevent
for(;;){
...;
}
```
2022-09-22 23:41:38 +07:00
2022-10-02 22:26:07 +07:00
### TCP 01
- Pointer of kevent
### TCP 02
- Array of kevent
2022-10-05 21:04:30 +07:00
### SCTP
- Listening
- Init ACK
> Find out how to make a stateless connection over SCTP.
2022-09-22 23:41:38 +07:00
## Goal
2022-10-02 22:26:07 +07:00
2022-09-22 23:41:38 +07:00
- Understand the difference between c++ and C
- Understand how strcuct works and the difference between it on c++ and C
- Understand
## Issues
- Modification to target file only detected after 2 or more interrupt