Skip to content
This repository was archived by the owner on Apr 9, 2025. It is now read-only.

use non-blocking socket #15

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/std/net.zig
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ pub fn tcpConnectToHost(allocator: mem.Allocator, name: []const u8, port: u16) T
pub const TcpConnectToAddressError = posix.SocketError || posix.ConnectError;

pub fn tcpConnectToAddress(address: Address) TcpConnectToAddressError!Stream {
const nonblock = 0;
const nonblock = posix.SOCK.NONBLOCK;
const sock_flags = posix.SOCK.STREAM | nonblock |
(if (native_os == .windows) 0 else posix.SOCK.CLOEXEC);
const sockfd = try posix.socket(address.any.family, sock_flags, posix.IPPROTO.TCP);
Expand Down