807 BOOST_REQUIRE(context.
hasSize(1));
810 communication.acceptConnectionAsServer(
"A",
"B",
"", 0, 1);
811 communication.send(message, 0);
812 communication.receive(message, 0);
813 BOOST_TEST(message == 2);
814 communication.closeConnection();
816 BOOST_REQUIRE(context.
isNamed(
"B"));
817 communication.requestConnectionAsClient(
"A",
"B",
"", {0}, 0);
818 communication.receive(message, 0);
819 BOOST_TEST(message == 1);
821 communication.send(message, 0);
822 communication.closeConnection();
831 BOOST_REQUIRE(context.
hasSize(2));
835 communication.acceptConnectionAsServer(
"A",
"B",
"", context.
rank, 2);
837 communication.send(10, 0);
838 communication.receive(message, 0);
839 BOOST_TEST(message == 20);
841 communication.send(20, 1);
842 communication.receive(message, 1);
843 BOOST_TEST(message == 40);
845 communication.closeConnection();
847 communication.acceptConnectionAsServer(
"A",
"B",
"", context.
rank, 0);
848 communication.closeConnection();
851 BOOST_REQUIRE(context.
isNamed(
"B"));
853 communication.requestConnectionAsClient(
"A",
"B",
"", {0}, context.
rank);
855 communication.receive(message, 0);
856 BOOST_TEST(message == 10);
858 communication.send(message, 0);
860 communication.closeConnection();
862 communication.requestConnectionAsClient(
"A",
"B",
"", {0}, context.
rank);
864 communication.receive(message, 0);
865 BOOST_TEST(message == 20);
867 communication.send(message, 0);
869 communication.closeConnection();
880 BOOST_REQUIRE(context.
hasSize(2));
885 communication.acceptConnectionAsServer(
"A",
"B",
"", 0, 2);
887 communication.send(10, 0);
888 communication.receive(message, 0);
889 BOOST_TEST(message == 20);
891 communication.send(100, 1);
892 communication.receive(message, 1);
893 BOOST_TEST(message == 200);
895 communication.closeConnection();
897 communication.acceptConnectionAsServer(
"A",
"B",
"", 1, 2);
899 communication.send(20, 0);
900 communication.receive(message, 0);
901 BOOST_TEST(message == 40);
903 communication.send(200, 1);
904 communication.receive(message, 1);
905 BOOST_TEST(message == 400);
907 communication.closeConnection();
911 BOOST_REQUIRE(context.
isNamed(
"B"));
914 communication.requestConnectionAsClient(
"A",
"B",
"", {0, 1}, 0);
916 communication.receive(message, 0);
917 BOOST_TEST(message == 10);
918 communication.send(20, 0);
920 communication.receive(message, 1);
921 BOOST_TEST(message == 20);
922 communication.send(40, 1);
924 communication.closeConnection();
926 communication.requestConnectionAsClient(
"A",
"B",
"", {0, 1}, 1);
928 communication.receive(message, 0);
929 BOOST_TEST(message == 100);
930 communication.send(200, 0);
932 communication.receive(message, 1);
933 BOOST_TEST(message == 200);
934 communication.send(400, 1);
936 communication.closeConnection();