socket flow logic implemented for 2 player