propagating close and end events to server