Add missing case if socket is closed and data is left in the msg queue