LLDB mainline
UDPSocket.h
Go to the documentation of this file.
1//===-- UDPSocket.h ---------------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_HOST_COMMON_UDPSOCKET_H
10#define LLDB_HOST_COMMON_UDPSOCKET_H
11
12#include "lldb/Host/Socket.h"
13
14namespace lldb_private {
15class UDPSocket : public Socket {
16public:
17 explicit UDPSocket(bool should_close);
18
19 static llvm::Expected<std::unique_ptr<UDPSocket>>
20 CreateConnected(llvm::StringRef name);
21
22 std::string GetRemoteConnectionURI() const override;
23
24private:
25 UDPSocket(NativeSocket socket);
26
27 size_t Send(const void *buf, const size_t num_bytes) override;
28 Status Connect(llvm::StringRef name) override;
29 Status Listen(llvm::StringRef name, int backlog) override;
30
31 llvm::Expected<std::vector<MainLoopBase::ReadHandleUP>>
33 std::function<void(std::unique_ptr<Socket> socket)> sock_cb) override {
34 return llvm::errorCodeToError(
35 std::make_error_code(std::errc::operation_not_supported));
36 }
37
39};
40}
41
42#endif // LLDB_HOST_COMMON_UDPSOCKET_H
An error handling class.
Definition: Status.h:118
static llvm::Expected< std::unique_ptr< UDPSocket > > CreateConnected(llvm::StringRef name)
Definition: UDPSocket.cpp:51
Status Listen(llvm::StringRef name, int backlog) override
Definition: UDPSocket.cpp:46
llvm::Expected< std::vector< MainLoopBase::ReadHandleUP > > Accept(MainLoopBase &loop, std::function< void(std::unique_ptr< Socket > socket)> sock_cb) override
Definition: UDPSocket.h:32
SocketAddress m_sockaddr
Definition: UDPSocket.h:38
std::string GetRemoteConnectionURI() const override
Definition: UDPSocket.cpp:128
Status Connect(llvm::StringRef name) override
Definition: UDPSocket.cpp:42
size_t Send(const void *buf, const size_t num_bytes) override
Definition: UDPSocket.cpp:37
A class that represents a running process on the host machine.
int NativeSocket
Definition: Socket.h:41