TcpServer
SimpleTV ver
SimpleTV v.0.4.8 b9 or above
object = CreateServer(table params)
Description
Parameters
Example
local p={}
p.address = '127.0.0.1'
p.service = '1234'
p.eventfunction = "TestTCPServer"
local server = m_simpleTV.TcpServer.CreateServer(p)
if server==nil then ERROR end
function TestTCPServer(Object,Event,Data) --event function
debug_in_file("event - " .. Event .. '\n')
debug_in_file("data - " .. Data .. '\n\n')
end
List of events
'Accept' - Client connected to server
'End' - Client disconnected
'Receive' - On received data (Data parameter is valid)
'Error' - On error (Data parameter is error string)
CloseServer(ServerObject)
Description
Parameters
ServerObject - object, returned by CreateServer
boolean = Send(ServerObject,string data)
Description
Parameters
number = GetWsaError(ServerObject)
Description
Parameters