void trydisconnect(bool local) { if(connpeer) { conoutf("aborting connection attempt"); abortconnect(); } else if(curpeer) { conoutf("attempting to disconnect..."); disconnect(!discmillis); } else if(local && haslocalclients()) localdisconnect(); else conoutf("not connected"); }
bool connected(bool attempt, bool local) { return curpeer || (attempt && connpeer) || (local && haslocalclients()); }