Exemple #1
0
/// Test async rendezvous
int testAsyncRendezvous () {
	UDTSocket a;
	UDTSocket b;
	Error e = a.bind();
	tassert1 (!e);
	e = b.bind();
	tassert1 (!e);
	ResultCallbackHelper helperA;
	ResultCallbackHelper helperB;
	a.connectRendezvousAsync("127.0.0.1", b.port(), helperA.onResultFunc());
	b.connectRendezvousAsync("127.0.0.1", a.port(), helperB.onResultFunc());
	bool suc = helperA.waitUntilReady (2000);
	tassert (suc, "Must connect");
	suc = helperB.waitUntilReady(2000);
	tassert (suc, "Must connect");
	tassert1 (testConnectivity (&a, &b) == 0);
	return 0;
}