Skip to content

Commit

Permalink
Fixing FindUnusedPort method tcp_socket object creation with proper c…
Browse files Browse the repository at this point in the history
…onstructor parameter (llvm#121879)

### Issue: 
Currently lldb `platform connect unix-connect://localhost:43045/` is
failing and showing "Failed to connect port" error message.
 

![IMG_2492](https://github.com/user-attachments/assets/816931e2-8b06-427e-b11a-39b813094e36)


###  Cause:
TCPSocket(bool should_close, bool child_processes_inherit) constructor
was removed in commit
[c1dff71](llvm@c1dff71#diff-91817651b505a466ea94ddc44eca856f62073e03b05d0d0d2f4a55dcfea0002eL20).
However, the tcp_socket object creation still passes the deleted
constructor parameters, which causes the invocation of the wrong
constructor. As a result, the `FindUnusedPort` method is unable to
resolve the local port and always returns 0.
  • Loading branch information
SiamAbdullah authored Jan 7, 2025
1 parent e7a83fc commit 56936ec
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static Status DeleteForwardPortWithAdb(uint16_t local_port,

static Status FindUnusedPort(uint16_t &port) {
Status error;
std::unique_ptr<TCPSocket> tcp_socket(new TCPSocket(true, false));
std::unique_ptr<TCPSocket> tcp_socket(new TCPSocket(true));
if (error.Fail())
return error;

Expand Down

0 comments on commit 56936ec

Please sign in to comment.