string hosts in net.*

This commit is contained in:
2026-06-07 09:33:26 +02:00
parent a727a52ffb
commit a9bd4fe9f9
8 changed files with 109 additions and 71 deletions

View File

@@ -49,7 +49,7 @@ func CHIP8.free[c: CHIP8] : void
c->keyboard->free()
c->display->free()
c->keyboard_map->free()
(c as ptr)->free()
mem.free(c)
func CHIP8.disassemble[c: CHIP8, ins_count: i64] : void
for i in 0..ins_count

View File

@@ -26,11 +26,7 @@ func main[argc: i64, argv: ptr] : i64
if i < url_len
path = url->substr(i, url_len - i)
~addr, ok := net.resolve(host)
if !ok
panic("failed to resolve host")
~s, ok := net.connect(addr, 80)
~s, ok := net.connect(host, 80)
if !ok
panic("failed to connect")

View File

@@ -26,7 +26,6 @@ func main[] : i64
for i in 0..lines->size
line : str = lines->nth(i)
parts := line->split(" ")
l1->push((parts->nth(0) as str)->parse_i64())

View File

@@ -1,5 +1,5 @@
func main[] : i64
~s, ok := net.listen(net.pack_addr(127, 0, 0, 1), 8000)
~s, ok := net.listen("127.0.0.1", 8000)
if !ok
panic("failed to listen")

View File

@@ -1,5 +1,5 @@
func main[] : i64
~s, ok := net.create_udp_server(net.pack_addr(127, 0, 0, 1), 8000)
~s, ok := net.create_udp_server("127.0.0.1", 8000)
if !ok
panic("net.create_udp_server failed")