Made server restart on connection
Updated with changes from ios project