term socket thread , fix issue #47