close socket when finishing forwarding