FBA The Creator

The True Multiplatform PC / PocketPC Opensource Development Tool - Read Only Mode - Kept only for historical purposes - Thank you all ;)
It is currently Wed Sep 18, 2019 7:17 am

All times are UTC




Post new topic  Reply to topic  [ 1 post ] 
Author Message
 Post subject: Event Handler
PostPosted: Mon Sep 13, 2010 2:21 pm 
Offline

Joined: Tue Apr 27, 2010 9:26 pm
Posts: 1
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


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited