[FOLD] reformat dispatch switch
[FOLD] break message loop on socket closure