http server
This commit is contained in:
@@ -9,8 +9,8 @@ setsockopt :: (fd: s32, level: s32, optname: s32, optval: *s32, optlen: u32) ->
|
||||
bind :: (fd: s32, addr: *SockAddr, addrlen: u32) -> s32 #foreign libc;
|
||||
listen :: (fd: s32, backlog: s32) -> s32 #foreign libc;
|
||||
accept :: (fd: s32, addr: *SockAddr, addrlen: *u32) -> s32 #foreign libc;
|
||||
read :: (fd: s32, buf: [:0]u8, count: s64) -> s64 #foreign libc;
|
||||
write :: (fd: s32, buf: [:0]u8, count: s64) -> s64 #foreign libc;
|
||||
read :: (fd: s32, buf: [*]u8, count: s64) -> s64 #foreign libc;
|
||||
write :: (fd: s32, buf: [*]u8, count: s64) -> s64 #foreign libc;
|
||||
close :: (fd: s32) -> s32 #foreign libc;
|
||||
|
||||
// Constants (macOS)
|
||||
@@ -24,8 +24,8 @@ SockAddr :: struct {
|
||||
sin_len: u8;
|
||||
sin_family: u8;
|
||||
sin_port: u16;
|
||||
sin_addr: u32;
|
||||
sin_zero: u64;
|
||||
sin_addr: u32 = 0;
|
||||
sin_zero: u64 = 0;
|
||||
}
|
||||
|
||||
htons :: (port: s64) -> u16 {
|
||||
|
||||
Reference in New Issue
Block a user