On this page
article
peary/interfaces/IPSocket/ipsocket.hpp
peary/interfaces/IPSocket/ipsocket.hpp
Peary IPSocketb Interface. More…
Namespaces
| Name |
|---|
| peary |
| peary::interface |
Classes
| Name | |
|---|---|
| class | peary::interface::iface_ipsocket Configuration class for IPSocket interface. |
Detailed Description
Peary IPSocketb Interface.
Copyright: Copyright (c) 2016-2025 CERN and the Peary Caribou authors. This software is distributed under the terms of the LGPL-3.0-only License, copied verbatim in the file “LICENSE.md”. SPDX-License-Identifier: LGPL-3.0-only
Source code
#pragma once
#include <cstdint>
#include <string>
#include <vector>
#include "peary/interfaces/Interface.hpp"
#include "peary/interfaces/InterfaceManager.hpp"
#include "peary/utils/exceptions.hpp"
namespace peary::interface {
using ipsocket_port_t = uint32_t;
using ipsocket_t = std::string;
class iface_ipsocket : public Interface<ipsocket_t, ipsocket_t> {
private:
explicit iface_ipsocket(const configuration_type& config);
~iface_ipsocket() override;
GENERATE_FRIENDS()
public:
ipsocket_t write(const ipsocket_t& payload) override;
dataVector_type read(const ipsocket_t& query, const unsigned int length) override;
std::vector<uint8_t> read_binary(const ipsocket_t& query, const unsigned int length);
iface_ipsocket() = delete;
private:
std::pair<std::string, uint16_t> split_ip_address(const std::string& address);
// Called from read() and write() while holding the lock
ipsocket_t write_nolock(const ipsocket_t& payload);
std::string trim(const std::string& str, const std::string& delims = " \t\n\r\v");
std::string cleanCommandString(std::string& command);
// Remote socket to connect to
int mysocket_;
friend iface_ipsocket& InterfaceManager::getInterface<iface_ipsocket>(const configuration_type&);
friend void InterfaceManager::deleteInterface<iface_ipsocket>(iface_ipsocket*);
};
} // namespace peary::interface
Updated on 2025-11-14 at 11:31:23 +0100