Improved server example
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user