diff options
| -rw-r--r-- | xmake/modules/private/service/stream.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/xmake/modules/private/service/stream.lua b/xmake/modules/private/service/stream.lua index 8cb802ab8..aab400558 100644 --- a/xmake/modules/private/service/stream.lua +++ b/xmake/modules/private/service/stream.lua @@ -202,6 +202,16 @@ function stream:send_file(filepath, opt) return ok end +-- send files +function stream:send_files(filepaths, opt) + for _, filepath in ipairs(filepaths) do + if not self:send_file(filepath, opt) then + return false + end + end + return true +end + -- recv the given bytes function stream:recv(buff, size) assert(size <= buff:size(), "too large size(%d)", size) @@ -348,6 +358,16 @@ function stream:recv_file(filepath) end end +-- recv files +function stream:recv_files(filepaths) + for _, filepath in ipairs(filepaths) do + if not self:recv_file(filepath) then + return false + end + end + return true +end + -- recv compressed file function stream:_recv_compressed_file(lz4_stream, filepath, size) local buff = self._BUFF |
