Made client and server to receive and send messages from and to Server
using StateMachine design.