public GameForm() { InitializeComponent(); game = new Game(); networkClient = NetworkClient.getInstance(Constant.SERVER_IP, Constant.SEND_PORT,Constant.LISTEN_PORT); networkClient.OnRecieve += onRecieve; }
public static NetworkClient getInstance(string ipAddress, int sendPort, int listenPort) { if(instance==null) { instance = new NetworkClient(ipAddress, sendPort, listenPort); } return instance; }