Commit 55e1416
feat<kcp>: ensure UDP sockets are non-blocking for libuv integration
This commit ensures KCP's UDP sockets are explicitly set to non-blocking mode
for proper integration with libuv's event loop system.
Key changes:
- Added set_socket_nonblocking() helper function using fcntl() with O_NONBLOCK
- Updated server-side UDP socket creation to set non-blocking mode
- Updated client-side UDP socket creation to set non-blocking mode
- Added proper error handling and cleanup mechanisms
- Verified function inclusion in libuv library and test executables
Benefits:
- Prevents blocking behavior in libuv event loop
- Enables efficient event-driven I/O
- Maintains clean architecture with individual UDP sockets per connection
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>1 parent 7beff81 commit 55e1416
4 files changed
+30
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
64 | 70 | | |
65 | 71 | | |
66 | 72 | | |
| |||
188 | 194 | | |
189 | 195 | | |
190 | 196 | | |
191 | | - | |
| 197 | + | |
192 | 198 | | |
193 | 199 | | |
194 | 200 | | |
| |||
199 | 205 | | |
200 | 206 | | |
201 | 207 | | |
202 | | - | |
| 208 | + | |
203 | 209 | | |
204 | 210 | | |
205 | 211 | | |
| |||
210 | 216 | | |
211 | 217 | | |
212 | 218 | | |
213 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
777 | 777 | | |
778 | 778 | | |
779 | 779 | | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
780 | 786 | | |
781 | 787 | | |
782 | 788 | | |
| |||
Submodule uvudt updated from 18c77a7 to 10392cd
0 commit comments