stream: probable fix for socket hangup