issue with a server

Discuss any general programming issues here
Post Reply
xabierpayet
Posts: 267
Joined: Fri Feb 24, 2012 9:34 am

issue with a server

Post 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....
xabierpayet
Posts: 267
Joined: Fri Feb 24, 2012 9:34 am

Re: issue with a server

Post by xabierpayet »

User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: issue with a server

Post by airsoftsoftwair »

Sorry, compiled apps don't help in debugging stuff. You need to provide a very small example script that shows the issue.
xabierpayet
Posts: 267
Joined: Fri Feb 24, 2012 9:34 am

Re: issue with a server

Post 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.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: issue with a server

Post by airsoftsoftwair »

Ok, I can confirm this. I'll see what I can do about it.
xabierpayet
Posts: 267
Joined: Fri Feb 24, 2012 9:34 am

Re: issue with a server

Post by xabierpayet »

thankyou
Post Reply