From 0912247e24c7e3faaa801eb562b3869273f628ee Mon Sep 17 00:00:00 2001 From: Kiritow <1362050620@qq.com> Date: Wed, 12 Dec 2018 03:44:22 +0800 Subject: [PATCH] Update libftp --- libs/std/libftp.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libs/std/libftp.lua b/libs/std/libftp.lua index 86fc868..8eb243a 100644 --- a/libs/std/libftp.lua +++ b/libs/std/libftp.lua @@ -168,6 +168,16 @@ local function ftp_close(t) end end +--[[ +Socket Adapter Requirements + A socket adapter should have the following methods: + create(): handle -- Create a TCP socket. + connect(h: handle, ip: string, port: number) -- Connect to server + send(h: handle, data: string) -- Send all part of data via socket. + read(h: handle, size: number) -- Read at most size byte of data. If socket is closed with nothing left, throws an exception. + close(h: handle) -- Clean up and close the socket. +--]] + local function FTP(socket_adapter) local t={} t.closed=false