added socket functions to serve a 2-player game