Improved server example

This commit is contained in:
Eduard Urbach 2025-02-08 17:34:11 +01:00
parent b2030c506c
commit 971b7f4b76
Signed by: eduard
GPG key ID: 49226B848C78F6C8
5 changed files with 37 additions and 10 deletions

10
lib/net/net_mac.q Normal file
View file

@ -0,0 +1,10 @@
import sys
bind(socket Int, port Int) -> Int {
addr := new(sys.sockaddr_in_bsd)
addr.sin_family = 2
addr.sin_port = port
err := sys.bind(socket, addr, 20)
delete(addr)
return err
}