diff options
| author | Oleksiy Vyalov <ovyalov@google.com> | 2015-10-15 23:54:09 +0000 |
|---|---|---|
| committer | Oleksiy Vyalov <ovyalov@google.com> | 2015-10-15 23:54:09 +0000 |
| commit | e98628cecbe1d1731a5b0181a0d2723621cb297c (patch) | |
| tree | dac18f72df0ba71eb7d77b64d35ed3733511095b /lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp | |
| parent | 15709991d09d940834029baf20a078d44f55234a (diff) | |
| download | bcm5719-llvm-e98628cecbe1d1731a5b0181a0d2723621cb297c.tar.gz bcm5719-llvm-e98628cecbe1d1731a5b0181a0d2723621cb297c.zip | |
Split Socket class into Tcp/Udp/DomainSocket subclasses.
http://reviews.llvm.org/D13754
llvm-svn: 250474
Diffstat (limited to 'lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp')
| -rw-r--r-- | lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp index 4eb1e811cb6..3e07442994b 100644 --- a/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp +++ b/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp @@ -10,9 +10,7 @@ // Other libraries and framework includes #include "lldb/Core/Error.h" #include "lldb/Core/Log.h" -#include "lldb/Host/Socket.h" - -// Project includes +#include "lldb/Host/common/TCPSocket.h" #include "AdbClient.h" #include "PlatformAndroidRemoteGDBServer.h" #include "Utility/UriParser.h" @@ -52,13 +50,15 @@ DeleteForwardPortWithAdb (uint16_t local_port, const std::string& device_id) static Error FindUnusedPort (uint16_t& port) { - Socket* socket = nullptr; - auto error = Socket::TcpListen ("127.0.0.1:0", false, socket, nullptr); - if (error.Success ()) - { - port = socket->GetLocalPortNumber (); - delete socket; - } + Error error; + std::unique_ptr<TCPSocket> tcp_socket(new TCPSocket(false, error)); + if (error.Fail()) + return error; + + error = tcp_socket->Listen("127.0.0.1:0", 1); + if (error.Success()) + port = tcp_socket->GetLocalPortNumber(); + return error; } |

