Lines Matching refs:clientSocket
208 static void fakeRemoteSocketPair(unique_fd* clientSocket, unique_fd* serverSocket,
704 void NetdBinderTest::fakeRemoteSocketPair(unique_fd* clientSocket, unique_fd* serverSocket, in fakeRemoteSocketPair() argument
714 clientSocket->reset(socket(AF_INET6, SOCK_STREAM | SOCK_CLOEXEC, 0)); in fakeRemoteSocketPair()
716 ASSERT_EQ(0, bind(*clientSocket, (struct sockaddr *) &client6, sizeof(client6))); in fakeRemoteSocketPair()
717 ASSERT_EQ(0, connect(*clientSocket, (struct sockaddr *) &server6, sizeof(server6))); in fakeRemoteSocketPair()
718 ASSERT_EQ(0, getsockname(*clientSocket, (struct sockaddr *) &client6, &addrlen)); in fakeRemoteSocketPair()
727 void checkSocketpairOpen(int clientSocket, int acceptedSocket) { in checkSocketpairOpen() argument
729 EXPECT_EQ(4, write(clientSocket, "foo", sizeof("foo"))); in checkSocketpairOpen()
734 void checkSocketpairClosed(int clientSocket, int acceptedSocket) { in checkSocketpairClosed() argument
736 int ret = write(clientSocket, "foo", sizeof("foo")); in checkSocketpairClosed()
749 unique_fd clientSocket, serverSocket, acceptedSocket; in TEST_F() local
750 ASSERT_NO_FATAL_FAILURE(fakeRemoteSocketPair(&clientSocket, &serverSocket, &acceptedSocket)); in TEST_F()
756 EXPECT_EQ(0, fchown(clientSocket, uid, -1)); in TEST_F()
770 checkSocketpairOpen(clientSocket, acceptedSocket); in TEST_F()
783 checkSocketpairOpen(clientSocket, acceptedSocket); in TEST_F()
788 checkSocketpairClosed(clientSocket, acceptedSocket); in TEST_F()