Page 1 of 1

issue with a server

Posted: Mon Jan 02, 2017 10:18 pm
by xabierpayet
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....

Re: issue with a server

Posted: Mon Jan 02, 2017 11:47 pm
by xabierpayet

Re: issue with a server

Posted: Tue Jan 03, 2017 9:43 pm
by airsoftsoftwair
Sorry, compiled apps don't help in debugging stuff. You need to provide a very small example script that shows the issue.

Re: issue with a server

Posted: Tue Jan 31, 2017 3:20 pm
by xabierpayet
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.

Re: issue with a server

Posted: Mon Feb 06, 2017 8:41 pm
by airsoftsoftwair
Ok, I can confirm this. I'll see what I can do about it.

Re: issue with a server

Posted: Tue Feb 07, 2017 12:48 am
by xabierpayet
thankyou