aboutsummaryrefslogtreecommitdiff
path: root/std/event/tcp.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-07-29 23:27:21 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-07-30 13:46:09 -0400
commit3c8d4e04ea000d087af4e77331340db1c8b1cef3 (patch)
tree8f6cc5c2e61d2659189f235529e7208b341270e7 /std/event/tcp.zig
parenta870228ab467906ecc663bf89ecd042b49e116f5 (diff)
downloadzig-3c8d4e04ea000d087af4e77331340db1c8b1cef3.tar.gz
zig-3c8d4e04ea000d087af4e77331340db1c8b1cef3.zip
std: file system watching for linux
Diffstat (limited to 'std/event/tcp.zig')
-rw-r--r--std/event/tcp.zig5
1 files changed, 2 insertions, 3 deletions
diff --git a/std/event/tcp.zig b/std/event/tcp.zig
index 416a8c07dc..42018b03e5 100644
--- a/std/event/tcp.zig
+++ b/std/event/tcp.zig
@@ -55,7 +55,7 @@ pub const Server = struct {
errdefer cancel self.accept_coro.?;
self.listen_resume_node.handle = self.accept_coro.?;
- try self.loop.addFd(sockfd, &self.listen_resume_node);
+ try self.loop.linuxAddFd(sockfd, &self.listen_resume_node, posix.EPOLLIN | posix.EPOLLOUT | posix.EPOLLET);
errdefer self.loop.removeFd(sockfd);
}
@@ -116,7 +116,7 @@ pub async fn connect(loop: *Loop, _address: *const std.net.Address) !std.os.File
errdefer std.os.close(sockfd);
try std.os.posixConnectAsync(sockfd, &address.os_addr);
- try await try async loop.waitFd(sockfd);
+ try await try async loop.linuxWaitFd(sockfd, posix.EPOLLIN | posix.EPOLLOUT);
try std.os.posixGetSockOptConnectError(sockfd);
return std.os.File.openHandle(sockfd);
@@ -181,4 +181,3 @@ async fn doAsyncTest(loop: *Loop, address: *const std.net.Address, server: *Serv
assert(mem.eql(u8, msg, "hello from server\n"));
server.close();
}
-