string hosts in net.*
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user