mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
net: add -d trace_tcp support for more TcpConn methods; support again -d net_blocking_sockets too
This commit is contained in:
@@ -213,12 +213,14 @@ fn new_udp_socket(local_addr Addr) ?&UdpSocket {
|
||||
s.set_dualstack(true) ?
|
||||
}
|
||||
|
||||
// NOTE: refer to comments in tcp.v
|
||||
$if windows {
|
||||
t := u32(1) // true
|
||||
socket_error(C.ioctlsocket(sockfd, fionbio, &t)) ?
|
||||
} $else {
|
||||
socket_error(C.fcntl(sockfd, C.F_SETFD, C.O_NONBLOCK)) ?
|
||||
$if !net_blocking_sockets ? {
|
||||
// NOTE: refer to comments in tcp.v
|
||||
$if windows {
|
||||
t := u32(1) // true
|
||||
socket_error(C.ioctlsocket(sockfd, fionbio, &t)) ?
|
||||
} $else {
|
||||
socket_error(C.fcntl(sockfd, C.F_SETFD, C.O_NONBLOCK)) ?
|
||||
}
|
||||
}
|
||||
|
||||
// cast to the correct type
|
||||
|
||||
Reference in New Issue
Block a user