issue with a server

Discuss any general programming issues here

issue with a server

Postby xabierpayet » Mon Jan 02, 2017 11:18 pm

i do a server for multipurposes with hollywood, it´s running cool, but, i have a little problem with it
when the users left the connection, sometimes the server don´t send the disconnect message, how i can
to know if all the users logged in the server still connected to it or not. For this experiment i do an apk called
ouija simulator dor android, normally i have >20 users online, if you can test it....
xabierpayet
 
Posts: 151
Joined: Fri Feb 24, 2012 10:34 am

Re: issue with a server

Postby xabierpayet » Tue Jan 03, 2017 12:47 am

xabierpayet
 
Posts: 151
Joined: Fri Feb 24, 2012 10:34 am

Re: issue with a server

Postby airsoftsoftwair » Tue Jan 03, 2017 10:43 pm

Sorry, compiled apps don't help in debugging stuff. You need to provide a very small example script that shows the issue.
User avatar
airsoftsoftwair
 
Posts: 2198
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany

Re: issue with a server

Postby xabierpayet » Tue Jan 31, 2017 4:20 pm

ok here is the example, the server:

CreateServer(1,2900)
conexions=0
Function p_ConnectFunc(msg)
Switch(msg.action)
Case "OnDisconnect":
closeconnection(msg.id)
conexions=conexions-1
Case "OnConnect":
conexions=conexions+1
conexioentrant=msg.clientid
Case "OnReceiveData":
data$ = ReceiveData(msg.id, #RECEIVELINE)
senddata(msg.id,data$)
EndSwitch
EndFunction
InstallEventHandler({OnConnect = p_ConnectFunc,OnDisconnect = p_ConnectFunc, onreceivedata=p_connectfunc})
begindoublebuffer()
repeat
cls
checkevent
locate(0,0)
print("conexions:",conexions)
IF CONEXIONS>0 THEN senddata(CONEXIOENTRANT,"PP")
flip()
forever

and here is the client:

serv$="192.169.1.123"
port=2550
OpenConnection(a, serv$,2900)
nprint("leftmouse to start")
waitleftmouse()
while(0=0)
senddata(1,"pp")
wend

the problem, if you executes the client in android, and closes the program swipping it in the list of open programs, the server don´t receive the desconnection message
if you removes the senddata command and closes the application using the same method, the server receive the order.
xabierpayet
 
Posts: 151
Joined: Fri Feb 24, 2012 10:34 am

Re: issue with a server

Postby airsoftsoftwair » Mon Feb 06, 2017 9:41 pm

Ok, I can confirm this. I'll see what I can do about it.
User avatar
airsoftsoftwair
 
Posts: 2198
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany

Re: issue with a server

Postby xabierpayet » Tue Feb 07, 2017 1:48 am

thankyou
xabierpayet
 
Posts: 151
Joined: Fri Feb 24, 2012 10:34 am


Return to General programming

Who is online

Users browsing this forum: Bing [Bot] and 1 guest