Open3D (C++ API)  0.18.0
Connection.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <memory>
11 #include <string>
12 
15 
16 namespace open3d {
17 namespace io {
18 namespace rpc {
19 
22 class Connection : public ConnectionBase {
23 public:
25  Connection();
26 
35  Connection(const std::string& address, int connect_timeout, int timeout);
36  ~Connection();
37 
39  std::shared_ptr<zmq::message_t> Send(zmq::message_t& send_msg);
40 
42  std::shared_ptr<zmq::message_t> Send(const void* data, size_t size);
43 
44  static std::string DefaultAddress();
45 
46 private:
47  std::shared_ptr<zmq::context_t> context_;
48  std::unique_ptr<zmq::socket_t> socket_;
49  const std::string address_;
50  const int connect_timeout_;
51  const int timeout_;
52 };
53 } // namespace rpc
54 } // namespace io
55 } // namespace open3d
Base class for all connections.
Definition: ConnectionBase.h:22
Definition: Connection.h:22
~Connection()
Definition: Connection.cpp:50
static std::string DefaultAddress()
Definition: Connection.cpp:79
std::shared_ptr< zmq::message_t > Send(zmq::message_t &send_msg)
Function for sending data wrapped in a zmq message object.
Definition: Connection.cpp:52
Connection()
Creates a connection with the default parameters.
Definition: Connection.cpp:31
int size
Definition: FilePCD.cpp:40
const char const char value recording_handle imu_sample recording_handle uint8_t data
Definition: K4aPlugin.cpp:269
Definition: PinholeCameraIntrinsic.cpp:16