Server->client reply

@kfrajer===

the Client for whom i am the Server is waiting…And he has to wait because as soon as i have got thes/c exchange to run i have to put the server on line and test it with a lot of connected: i am afraid that at this moment new problems arise! - Last: the same for android! - and foir the twos a database: so, it could be some time…:face_with_raised_eyebrow:

Akenaton:
I am not sure to understand why you don’t run the disconnectEvent in the SERVER side. If you did that, you would remove the client which just disconnected from the “connected players” list, kept on the server side, and if you want you can distribute the list to every connected client.

Concerning the User hitting the “stop” button: is there no way of catching it and closing the socket on the Client side?
Giulio

@giulio===

yes, it could also be done on serverSide ; i have to see wether it changes something for the stop button, which is the (mine) main problem: i cannot capture this event in a simple way. Try the code from KF, export an app and see what is happening…

akenaton,
I don’t know if this can help:

Look at the post where it suggests to override the exit() call. I tried it, and I am now able to catch the closing of the application through the x button

akenaton,
I found an entry in the forum which might help you, at

forum.processing.org/two/discussion/9408/run-code-when-closing-without-interfering

Look at the post by GoToLoop where it suggests to override the exit() function. I tried the example in my server, and I am able to catch the closing of the server through the x button!

Giulio