mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
net: add a net.tcp_socket_from_handle_raw
function (#16167)
This commit is contained in:
parent
158fd5c249
commit
340611c298
@ -398,6 +398,17 @@ fn tcp_socket_from_handle(sockfd int) !TcpSocket {
|
||||
return s
|
||||
}
|
||||
|
||||
// tcp_socket_from_handle_raw is similar to tcp_socket_from_handle, but it does not modify any socket options
|
||||
pub fn tcp_socket_from_handle_raw(sockfd int) TcpSocket {
|
||||
mut s := TcpSocket{
|
||||
handle: sockfd
|
||||
}
|
||||
$if trace_tcp ? {
|
||||
eprintln(' tcp_socket_from_handle_raw | s.handle: ${s.handle:6}')
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
pub fn (mut s TcpSocket) set_option_bool(opt SocketOption, value bool) ! {
|
||||
// TODO reenable when this `in` operation works again
|
||||
// if opt !in opts_can_set {
|
||||
|
Loading…
Reference in New Issue
Block a user