|
I wrote a piece of code in delphi where the ServerSocket receives a string from a Lua sock:send() and it replies with a serversocket.OnClientRead event that works seamlesly. Now I try a Server socket in FBA and what I don't get right is a on_client_read event handler to receive a string from a remote client. Can you actually write a onsocket event or must you poll the socket in the mainloop. Any sample code will be appreciated. I deliberately don't publish my efforts here because I clearly don't have a clue.
I need 2 samples --up to here i've created a listen port now I'm stuck
function OnClientConnect(socket) local remote_ip, remote_port = socket:getpeername() --already no joy here end
OnDataReceive(socket, buffer) --I don't have a idea how to receive the string from the remote client end
Regards Jean
|