Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:48

0001 //===-- UDPSocket.h ---------------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_HOST_COMMON_UDPSOCKET_H
0010 #define LLDB_HOST_COMMON_UDPSOCKET_H
0011 
0012 #include "lldb/Host/Socket.h"
0013 
0014 namespace lldb_private {
0015 class UDPSocket : public Socket {
0016 public:
0017   explicit UDPSocket(bool should_close);
0018 
0019   static llvm::Expected<std::unique_ptr<UDPSocket>>
0020   CreateConnected(llvm::StringRef name);
0021 
0022   std::string GetRemoteConnectionURI() const override;
0023 
0024 private:
0025   UDPSocket(NativeSocket socket);
0026 
0027   size_t Send(const void *buf, const size_t num_bytes) override;
0028   Status Connect(llvm::StringRef name) override;
0029   Status Listen(llvm::StringRef name, int backlog) override;
0030 
0031   llvm::Expected<std::vector<MainLoopBase::ReadHandleUP>>
0032   Accept(MainLoopBase &loop,
0033          std::function<void(std::unique_ptr<Socket> socket)> sock_cb) override {
0034     return llvm::errorCodeToError(
0035         std::make_error_code(std::errc::operation_not_supported));
0036   }
0037 
0038   SocketAddress m_sockaddr;
0039 };
0040 }
0041 
0042 #endif // LLDB_HOST_COMMON_UDPSOCKET_H