fix some keep-alived bug for ssl and sock