Инструменты пользователя

  • Зашли как Anonymous (Anonymous)
  • Выйти

Инструменты сайта


mantis:simpletv:api:tcpserver

TcpServer

SimpleTV ver
SimpleTV v.0.4.8 b9 or above

object = CreateServer(table params)

Description
Create tcp server
Parameters
table of a 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
Close tcp server
Parameters
ServerObject - object, returned by CreateServer

boolean = Send(ServerObject,string data)

Description
Send data to client
Parameters

number = GetWsaError(ServerObject)

Description
return last WSA error
Parameters
mantis/simpletv/api/tcpserver.txt · Последние изменения: 2020/01/29 23:38 (внешнее изменение)