# Server-\>client reply

**URL:** <https://discourse.processing.org/t/server-client-reply/1877>\
**Category:** Coding Questions\
**Created:** [July 18, 2018, 8:49am UTC](https://discourse.processing.org/t/server-client-reply/1877 "2018-07-18T08:49:58Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)\
**Post date:** [July 19, 2018, 1:39pm UTC](https://discourse.processing.org/t/server-client-reply/1877/21 "2018-07-19T13:39:29Z")

</div>

@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…🤨

---

<div class="post-metadata">

**Author:** ![giulio](https://avatars.discourse-cdn.com/v4/letter/g/45deac/32.png) [@giulio](https://discourse.processing.org/u/giulio)\
**Post date:** [July 19, 2018, 2:06pm UTC](https://discourse.processing.org/t/server-client-reply/1877/22 "2018-07-19T14:06:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)\
**Post date:** [July 19, 2018, 2:21pm UTC](https://discourse.processing.org/t/server-client-reply/1877/23 "2018-07-19T14:21:43Z")

</div>

@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…

---

<div class="post-metadata">

**Author:** ![giulio](https://avatars.discourse-cdn.com/v4/letter/g/45deac/32.png) [@giulio](https://discourse.processing.org/u/giulio)\
**Post date:** [July 19, 2018, 3:34pm UTC](https://discourse.processing.org/t/server-client-reply/1877/24 "2018-07-19T15:34:42Z")

</div>

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

> **[Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/9408/run-code-when-closing-without-interfering)**
>
> Processing is an electronic sketchbook, a language and a worldwide community. This is its forum.

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

---

<div class="post-metadata">

**Author:** ![giulio](https://avatars.discourse-cdn.com/v4/letter/g/45deac/32.png) [@giulio](https://discourse.processing.org/u/giulio)\
**Post date:** [July 19, 2018, 3:39pm UTC](https://discourse.processing.org/t/server-client-reply/1877/25 "2018-07-19T15:39:23Z")

</div>

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](http://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

[Previous page](https://discourse.processing.org/t/server-client-reply/1877.md?page=1)
