Commit 0a032e17 authored by Jason Paryani's avatar Jason Paryani

Add abortRead to AyncIoStream

This is analagous to shutdownWrite, but for the read end of the stream
parent c9332ebe
......@@ -180,6 +180,12 @@ public:
KJ_SYSCALL(shutdown(fd, SHUT_WR));
}
void abortRead() override {
// There's no legitimate way to get an AsyncStreamFd that isn't a socket through the
// UnixAsyncIoProvider interface.
KJ_SYSCALL(shutdown(fd, SHUT_RD));
}
void getsockopt(int level, int option, void* value, uint* length) override {
socklen_t socklen = *length;
KJ_SYSCALL(::getsockopt(fd, level, option, value, &socklen));
......
......@@ -64,6 +64,10 @@ public:
virtual void shutdownWrite() = 0;
// Cleanly shut down just the write end of the stream, while keeping the read end open.
virtual void abortRead() {}
// Similar to shutdownWrite, but this will shut down the read end of the stream, and should only
// be called when an error has occurred.
virtual void getsockopt(int level, int option, void* value, uint* length);
virtual void setsockopt(int level, int option, const void* value, uint length);
// Corresponds to getsockopt() and setsockopt() syscalls. Will throw an "unimplemented" exception
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment