Added test for msgsock module.

* Using flexmock to mock network socket.