Fix bug and refactor TCP to Unix Socket.