mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
windows: Unicode and IPv6 http/sockets
cleanup schannel implementation (drop NT4.0 compatibility, use unicode strings, etc) restore http tests fix socket test: it did not throw before
This commit is contained in:
committed by
Alexander Medvednikov
parent
22d91148ca
commit
9834ccfcd9
@@ -176,9 +176,11 @@ pub fn (s Socket) connect(address string, port int) ?int {
|
||||
hints.ai_family = C.AF_UNSPEC
|
||||
hints.ai_socktype = C.SOCK_STREAM
|
||||
hints.ai_flags = C.AI_PASSIVE
|
||||
hints.ai_protocol = 0
|
||||
hints.ai_addrlen = 0
|
||||
hints.ai_canonname = C.NULL
|
||||
hints.ai_addr = C.NULL
|
||||
hints.ai_next = C.NULL
|
||||
|
||||
|
||||
info := &C.addrinfo{!}
|
||||
|
||||
@@ -2,17 +2,14 @@ import net
|
||||
|
||||
fn test_socket() {
|
||||
mut server := net.listen(0) or {
|
||||
println(err)
|
||||
return
|
||||
panic(err)
|
||||
}
|
||||
server_port := server.get_port()
|
||||
mut client := net.dial('127.0.0.1', server_port) or {
|
||||
println(err)
|
||||
return
|
||||
panic(err)
|
||||
}
|
||||
mut socket := server.accept() or {
|
||||
println(err)
|
||||
return
|
||||
panic(err)
|
||||
}
|
||||
|
||||
message := 'Hello World'
|
||||
|
||||
Reference in New Issue
Block a user