rewrite protocol check with switch-case in Server.Daemon
Merge pull request #2502 from hamo/unlink_err_v4

rewrite protocol check with switch-case in Server.Daemon