sockets - Button not apear in android device but shown in corona simulator and mobogini -
I can see buttons in the Corona simulator and genomes, but on Android devices I do not see anything and no console The errors in this are the main. Lua and server.lua, please help me fix my problem
main.lua
local S = {} local socket = requirement ("Socket") local clientList = {} local clientBuffer = {} S.getIP = function local S = socket.udp (): setpeername ("74.125.115.104", 80) Local IP, Sock = s: Getockname (), (IP: "IIP:", IP, Sock) Returns IP and S Socket Surce = Function () Local TCP, IRL = Socket.Bind (SAGTAP (), 1235) - Create a server object TCP: Set Timeout (0) Local Function sPulse (repeat) Local Client = TCP: Accept () - If the client Then enter a new client to connect the print ("Client"): settimeout (0) - just check the socket and keep going - -TO DO: Apply a way to see if the client has already Connected - Tell the client the session ID to the client and use it on reconnect. ClientList [# clientList + 1] = Customer clientBuffer [customer] = {"hello_client"} --just the end are down, the customer is not ready to send the write-ready, hey = socket.select (clientList, clientList, 0) IELT = [i] local subdata = {} - it keeps all the lines from a given client, replicates the local data, = some, with some == zero for i = 1, # of the clients list - Client Error: Receive () - Get a line of data from the client, if Also - all the data [# allData + 1] = data will not end unless data (#allData> gt; 0) - then what the FIFA client told me for the server, in the iPad Print the data (all data) ("this data:", this data) - for the luggage sock with the end of the data, added in the buffer (client buffer) _, in the msg (buffer) - there will be empty local data May, err = sock: send (msg) - send message end to client end-end - pulse 10 sec per Seconds local server pulse = timer.performWithDelay (100, aspels, 0) local function (circle moment) - cancel timer TCP: for close (i) pairs, v (client list) v: close () End Return stop server and return s server.lua
local S =} local clientbuffer = {} S.getIP = function (local) s = socket.udp () s: setpeername ("74.125.115.104", 80) Local IP, SOC = S: Whitacam () print ("IIP:", IP, SOCK) Return IP & SCTRESER = Function (local) TCP, GAIL = SOCKET. BAND (SAGTAP (), 1235) - Create a server object TCP: Set timeout (0 ) Local Function S Pulse () Repeat Native Client = TCP: Accepted () - If the client returns a new client to reconnect to print (setterout client): settimeout (0) - just check the socket And keep going- TOO: check Apply a way to see what it is that the client has already connected - use it on client interaction session ID Clasnt and reconnect. ClientList [# clientList + 1] = Customer clientBuffer [customer] = {"hello_client"} --just the end are down, the customer is not ready to send the write-ready, hey = socket.select (clientList, clientList, 0) IELT = [i] local subdata = {} - it keeps all the lines from a given client, replicates the local data, = some, with some == zero for i = 1, # of the clients list - Client Error: Receive () - Get a line of data from the client, if Also - all the data [# allData + 1] = data will not end unless data (#allData> gt; 0) - then what the FIFA client told me for the server, in the iPad Print the data (all data) ("this data:", this data) - for the luggage sock with the end of the data, added in the buffer (client buffer) _, in the msg (buffer) - there will be empty local data May, err = sock: send (msg) - send message end to client end-end - pulse 10 sec per Seconds local server pulse = timer.performWithDelay (100, aspels, 0) local function (circle moment) - cancel timer TCP: for close (i) pairs, v (client list) v: close () End Return Stop Sovereign and Returns S
This problem was allowed I add "android.permission .INTERNET "
" android.permission.ACCESS_NETWORK_STATE "
and the problem is resolved
Comments
Post a Comment