Starting socket work
Got the communication of state almost ok