Home | History | Annotate | Download | only in windows

Lines Matching refs:port

36 bool IsPortAvailable(int* port, bool is_tcp) {
44 CHECK_GE(*port, 0);
45 CHECK_LE(*port, 65535);
63 // Try binding to port.
66 addr.sin_port = htons((uint16_t)*port);
69 LOG(WARNING) << "bind(port=" << *port
75 // Get the bound port number.
87 if (*port == 0) {
88 *port = actual_port;
90 CHECK_EQ(*port, actual_port);
111 // Type of port to first pick in the next iteration.
115 int port;
118 << "Failed to pick an unused port for testing.";
120 port = GetCurrentProcessId() % (65536 - 30000) + 30000;
122 port = rand() % (65536 - 30000) + 30000;
124 port = 0;
127 if (chosen_ports.find(port) != chosen_ports.end()) {
130 if (!IsPortAvailable(&port, is_tcp)) {
134 CHECK_GT(port, 0);
135 if (!IsPortAvailable(&port, !is_tcp)) {
140 chosen_ports.insert(port);
142 return port;