Lines Matching refs:server
35 bool MakeConnectedSockets(Socket::Protocol protocol, std::unique_ptr<Socket>* server, in MakeConnectedSockets() argument
38 *server = Socket::NewServer(protocol, 0); in MakeConnectedSockets()
39 if (*server == nullptr) { in MakeConnectedSockets()
44 *client = Socket::NewClient(protocol, hostname, (*server)->GetLocalPort(), nullptr); in MakeConnectedSockets()
52 *server = (*server)->Accept(); in MakeConnectedSockets()
53 if (*server == nullptr) { in MakeConnectedSockets()
78 std::unique_ptr<Socket> server, client; in TEST() local
81 ASSERT_TRUE(MakeConnectedSockets(protocol, &server, &client)); in TEST()
84 EXPECT_TRUE(ReceiveString(server.get(), "foo")); in TEST()
86 EXPECT_TRUE(SendString(server.get(), "bar baz")); in TEST()
92 std::unique_ptr<Socket> server, client; in TEST() local
96 ASSERT_TRUE(MakeConnectedSockets(protocol, &server, &client)); in TEST()
98 EXPECT_EQ(-1, server->Receive(buffer, sizeof(buffer), kShortTimeoutMs)); in TEST()
99 EXPECT_TRUE(server->ReceiveTimedOut()); in TEST()
106 ASSERT_TRUE(MakeConnectedSockets(Socket::Protocol::kUdp, &server, &client)); in TEST()
107 EXPECT_EQ(0, server->Close()); in TEST()
113 std::unique_ptr<Socket> server, client; in TEST() local
117 ASSERT_TRUE(MakeConnectedSockets(protocol, &server, &client)); in TEST()
119 EXPECT_EQ(0, server->Close()); in TEST()
120 EXPECT_EQ(-1, server->Receive(buffer, sizeof(buffer), kTestTimeoutMs)); in TEST()
121 EXPECT_FALSE(server->ReceiveTimedOut()); in TEST()
129 ASSERT_TRUE(MakeConnectedSockets(Socket::Protocol::kTcp, &server, &client)); in TEST()
130 EXPECT_EQ(0, server->Close()); in TEST()
138 std::unique_ptr<Socket> server, client; in TEST() local
141 ASSERT_TRUE(MakeConnectedSockets(protocol, &server, &client)); in TEST()
151 EXPECT_TRUE(ReceiveString(server.get(), message)); in TEST()
158 std::unique_ptr<Socket> server, client; in TEST() local
159 ASSERT_TRUE(MakeConnectedSockets(Socket::Protocol::kUdp, &server, &client)); in TEST()
165 ssize_t bytes = server->Receive(buffer, 5, kTestTimeoutMs); in TEST()