# bend-sendfile: package entry for BendHub. # Source: bendlang/bend PR #1117 (reviewed by VictorTaelin; closed as # WONTFIX (CAPACITY) and rerouted here: "a foreign effect a hub package can # ship with no loss ... the same C code"). # # The file's bytes, from an offset, straight onto a socket: the kernel's # sendfile on the C lane, so no byte passes through the program; the JS twin # copies through a buffer (Node has no sendfile) and says so. Every lane # leaves the file's position alone. Done once all len bytes are out; a file # that ends first fails with ENODATA after what it had went out. import Base # The file's bytes from off, len of them, onto the socket: the kernel's # sendfile on the C lane, so no byte passes through the program; every # lane leaves the file's position alone. Done once all len are out; a # file that ends first fails with ENODATA after what it had went out. def File.sendfile(sock: Socket, file: File, off: U32, len: U32) -> IO(Socket & File & Result<&1, &1, U32 & String, Unit>): import "./file_sendfile.c" import "./file_sendfile.js"