Improved server example
This commit is contained in:
parent
526385280a
commit
d0d096bcd2
5 changed files with 37 additions and 10 deletions
10
lib/net/net_linux.q
Normal file
10
lib/net/net_linux.q
Normal file
|
@ -0,0 +1,10 @@
|
|||
import sys
|
||||
|
||||
bind(socket Int, port Int) -> Int {
|
||||
addr := new(sys.sockaddr_in)
|
||||
addr.sin_family = 2
|
||||
addr.sin_port = port
|
||||
err := sys.bind(socket, addr, 20)
|
||||
delete(addr)
|
||||
return err
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue