Improved server example
This commit is contained in:
parent
b2030c506c
commit
971b7f4b76
5 changed files with 37 additions and 10 deletions
|
@ -1,3 +1,11 @@
|
|||
struct sockaddr_in_bsd {
|
||||
sin_len Int8
|
||||
sin_family Int8
|
||||
sin_port Int16
|
||||
sin_addr Int64
|
||||
sin_zero Int64
|
||||
}
|
||||
|
||||
socket(family Int, type Int, protocol Int) -> Int {
|
||||
return syscall(0x2000061, family, type, protocol)
|
||||
}
|
||||
|
@ -6,7 +14,7 @@ accept(fd Int, address Pointer, length Int) -> Int {
|
|||
return syscall(0x200001E, fd, address, length)
|
||||
}
|
||||
|
||||
bind(fd Int, address Pointer, length Int) -> Int {
|
||||
bind(fd Int, address *sockaddr_in_bsd, length Int) -> Int {
|
||||
return syscall(0x2000068, fd, address, length)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue