@@ -167,26 +167,13 @@ Socket::TcpListen(llvm::StringRef host_and_port, bool child_processes_inherit,
167
167
Log *log (lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION));
168
168
LLDB_LOG (log, " host_and_port = {0}" , host_and_port);
169
169
170
- std::string host_str;
171
- std::string port_str;
172
- uint16_t port;
173
- if (llvm::Error decode_error =
174
- DecodeHostAndPort (host_and_port, host_str, port_str, port))
175
- return std::move (decode_error);
176
-
177
170
std::unique_ptr<TCPSocket> listen_socket (
178
171
new TCPSocket (true , child_processes_inherit));
179
172
180
173
Status error = listen_socket->Listen (host_and_port, backlog);
181
174
if (error.Fail ())
182
175
return error.ToError ();
183
176
184
- // We were asked to listen on port zero which means we must now read the
185
- // actual port that was given to us as port zero is a special code for
186
- // "find an open port for me".
187
- if (port == 0 )
188
- port = listen_socket->GetLocalPortNumber ();
189
-
190
177
return std::move (listen_socket);
191
178
}
192
179
@@ -196,70 +183,6 @@ Socket::UdpConnect(llvm::StringRef host_and_port,
196
183
return UDPSocket::Connect (host_and_port, child_processes_inherit);
197
184
}
198
185
199
- Status Socket::UnixDomainConnect (llvm::StringRef name,
200
- bool child_processes_inherit,
201
- Socket *&socket) {
202
- Status error;
203
- std::unique_ptr<Socket> connect_socket (
204
- Create (ProtocolUnixDomain, child_processes_inherit, error));
205
- if (error.Fail ())
206
- return error;
207
-
208
- error = connect_socket->Connect (name);
209
- if (error.Success ())
210
- socket = connect_socket.release ();
211
-
212
- return error;
213
- }
214
-
215
- Status Socket::UnixDomainAccept (llvm::StringRef name,
216
- bool child_processes_inherit, Socket *&socket) {
217
- Status error;
218
- std::unique_ptr<Socket> listen_socket (
219
- Create (ProtocolUnixDomain, child_processes_inherit, error));
220
- if (error.Fail ())
221
- return error;
222
-
223
- error = listen_socket->Listen (name, 5 );
224
- if (error.Fail ())
225
- return error;
226
-
227
- error = listen_socket->Accept (socket);
228
- return error;
229
- }
230
-
231
- Status Socket::UnixAbstractConnect (llvm::StringRef name,
232
- bool child_processes_inherit,
233
- Socket *&socket) {
234
- Status error;
235
- std::unique_ptr<Socket> connect_socket (
236
- Create (ProtocolUnixAbstract, child_processes_inherit, error));
237
- if (error.Fail ())
238
- return error;
239
-
240
- error = connect_socket->Connect (name);
241
- if (error.Success ())
242
- socket = connect_socket.release ();
243
- return error;
244
- }
245
-
246
- Status Socket::UnixAbstractAccept (llvm::StringRef name,
247
- bool child_processes_inherit,
248
- Socket *&socket) {
249
- Status error;
250
- std::unique_ptr<Socket> listen_socket (
251
- Create (ProtocolUnixAbstract, child_processes_inherit, error));
252
- if (error.Fail ())
253
- return error;
254
-
255
- error = listen_socket->Listen (name, 5 );
256
- if (error.Fail ())
257
- return error;
258
-
259
- error = listen_socket->Accept (socket);
260
- return error;
261
- }
262
-
263
186
llvm::Error Socket::DecodeHostAndPort (llvm::StringRef host_and_port,
264
187
std::string &host_str,
265
188
std::string &port_str, uint16_t &port) {
0 commit comments