server cancel should shutdown

And some smarter shutdown handling...
close window handling