mirror of
git://git.psyced.org/git/psyced
synced 2024-08-15 03:25:10 +00:00
unlink detection rewrite - please test this
This commit is contained in:
parent
6b8e138eb4
commit
b4867481f4
7 changed files with 70 additions and 36 deletions
|
@ -19,7 +19,8 @@ inherit PSYC_PATH "circuit";
|
|||
// keep a list of objects to ->disconnected() when the driver tells us
|
||||
volatile array(object) disconnect_notifies;
|
||||
|
||||
void do_notify_on_disconnect(object user) {
|
||||
void register_link(object user) {
|
||||
P4(("disconnect_notifies for %O in %O\n", user, ME))
|
||||
unless(disconnect_notifies)
|
||||
disconnect_notifies = ({ });
|
||||
disconnect_notifies += ({ user });
|
||||
|
@ -54,11 +55,10 @@ protected quit() { QUIT }
|
|||
|
||||
// self-destruct when the TCP link gets lost
|
||||
disconnected(remaining) {
|
||||
P2(( "%O got disconnected.\n", ME))
|
||||
// emulate disconnected() for net/psyc/user
|
||||
if (disconnect_notifies) {
|
||||
foreach (object t : disconnect_notifies)
|
||||
if (t) t->disconnected();
|
||||
if (disconnect_notifies) foreach (object t : disconnect_notifies) {
|
||||
P3(( "%O disconnecting %O\n", ME, t))
|
||||
if (t) t->link_disconnected();
|
||||
}
|
||||
::disconnected(remaining);
|
||||
QUIT // returns unexpected.. TODO
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue