Fix some synchronize problems and socket problems

Now the message communication is available. But it's still not able to
pass data. Fix some synchronized problems.