mirror of
https://github.com/Drop-OSS/libtailscale.git
synced 2026-07-20 23:45:03 -04:00
libtailscale: make tailscale_listener pollable
Use a socketpair(2) and sendmsg/recvmsg to pass a connection fd from Go to C. This lets people write non-blocking C by polling on a tailscale_listener for when they should tailscale_accept. Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
This commit is contained in:
committed by
David Crawshaw
parent
42597d5fb7
commit
b0e2f4a4e4
@@ -46,7 +46,7 @@ int main(void) {
|
||||
}
|
||||
close(conn);
|
||||
}
|
||||
tailscale_listener_close(ln);
|
||||
close(ln);
|
||||
tailscale_close(ts);
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user