Commit 5c242b5f authored by Dominik Charousset's avatar Dominik Charousset

Remove scaffold for datagram abstraction

This feature has been moved to later release of the lib.
parent 7ef13e96
...@@ -209,32 +209,6 @@ class broker : public extend<local_actor>:: ...@@ -209,32 +209,6 @@ class broker : public extend<local_actor>::
*/ */
void flush(connection_handle hdl); void flush(connection_handle hdl);
struct datagram_handle {
buffer_type* buf;
datagram_endpoint dest;
};
/**
* @brief Returns a new buffer for the given endpoint. Note that each call
* to this member function will return a new buffer.
*/
datagram_handle new_datagram(datagram_endpoint ep);
/**
* @brief Sends the datagram.
*/
void send_datagram(datagram_handle ep);
inline void send_datagram(datagram_endpoint ep,
size_t data_size,
const void* data) {
auto hdl = new_datagram(ep);
auto first = reinterpret_cast<const char*>(data);
auto last = first + data_size;
hdl.buf->insert(hdl.buf->end(), first, last);
send_datagram(hdl);
}
/** /**
* @brief Returns the number of open connections. * @brief Returns the number of open connections.
*/ */
...@@ -367,12 +341,6 @@ class broker : public extend<local_actor>:: ...@@ -367,12 +341,6 @@ class broker : public extend<local_actor>::
return ptr->hdl(); return ptr->hdl();
} }
template<class DatagramSocket>
datagram_source_handle add_datagram_source(DatagramSocket sock) {
// ToDo: implement me
return invalid_datagram_source_handle;
}
void enqueue(const actor_addr&, message_id, message, void enqueue(const actor_addr&, message_id, message,
execution_unit*) override; execution_unit*) override;
......
/******************************************************************************\
* ___ __ *
* /\_ \ __/\ \ *
* \//\ \ /\_\ \ \____ ___ _____ _____ __ *
* \ \ \ \/\ \ \ '__`\ /'___\/\ '__`\/\ '__`\ /'__`\ *
* \_\ \_\ \ \ \ \L\ \/\ \__/\ \ \L\ \ \ \L\ \/\ \L\.\_ *
* /\____\\ \_\ \_,__/\ \____\\ \ ,__/\ \ ,__/\ \__/.\_\ *
* \/____/ \/_/\/___/ \/____/ \ \ \/ \ \ \/ \/__/\/_/ *
* \ \_\ \ \_\ *
* \/_/ \/_/ *
* *
* Copyright (C) 2011 - 2014 *
* Dominik Charousset <dominik.charousset (at) haw-hamburg.de> *
* *
* Distributed under the Boost Software License, Version 1.0. See *
* accompanying file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt *
\******************************************************************************/
#ifndef CPPA_IO_DATAGRAM_ENDPOINT_HPP
#define CPPA_IO_DATAGRAM_ENDPOINT_HPP
#include <memory>
#include "cppa/io/network.hpp"
namespace cppa {
namespace io {
using datagram_endpoint = std::shared_ptr<network::datagram_endpoint_data>;
} // namespace io
} // namespace cppa
#endif // CPPA_IO_DATAGRAM_ENDPOINT_HPP
/******************************************************************************\
* ___ __ *
* /\_ \ __/\ \ *
* \//\ \ /\_\ \ \____ ___ _____ _____ __ *
* \ \ \ \/\ \ \ '__`\ /'___\/\ '__`\/\ '__`\ /'__`\ *
* \_\ \_\ \ \ \ \L\ \/\ \__/\ \ \L\ \ \ \L\ \/\ \L\.\_ *
* /\____\\ \_\ \_,__/\ \____\\ \ ,__/\ \ ,__/\ \__/.\_\ *
* \/____/ \/_/\/___/ \/____/ \ \ \/ \ \ \/ \/__/\/_/ *
* \ \_\ \ \_\ *
* \/_/ \/_/ *
* *
* Copyright (C) 2011 - 2014 *
* Dominik Charousset <dominik.charousset (at) haw-hamburg.de> *
* *
* Distributed under the Boost Software License, Version 1.0. See *
* accompanying file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt *
\******************************************************************************/
#ifndef CPPA_IO_DATAGRAM_SOURCE_HANDLE_HPP
#define CPPA_IO_DATAGRAM_SOURCE_HANDLE_HPP
#include "cppa/io_handle.hpp"
namespace cppa {
namespace io {
/**
* @brief Generic handle type for identifying connections.
*/
class datagram_source_handle : public io_handle<datagram_source_handle> {
friend class io_handle<datagram_source_handle>;
using super = io_handle<datagram_source_handle>;
public:
constexpr datagram_source_handle() { }
private:
inline datagram_source_handle(int64_t handle_id) : super{handle_id} { }
};
constexpr datagram_source_handle invalid_datagram_source_handle{};
} // namespace io
} // namespace cppa
#endif // CPPA_IO_DATAGRAM_SOURCE_HANDLE_HPP
...@@ -123,11 +123,6 @@ namespace network { ...@@ -123,11 +123,6 @@ namespace network {
constexpr int ec_interrupted_syscall = EINTR; constexpr int ec_interrupted_syscall = EINTR;
#endif #endif
struct datagram_endpoint_data {
sockaddr addr;
socklen_t addrlen;
};
/** /**
* @brief Platform-specific native socket type. * @brief Platform-specific native socket type.
*/ */
......
...@@ -28,9 +28,6 @@ ...@@ -28,9 +28,6 @@
#include "cppa/accept_handle.hpp" #include "cppa/accept_handle.hpp"
#include "cppa/connection_handle.hpp" #include "cppa/connection_handle.hpp"
#include "cppa/io/datagram_endpoint.hpp"
#include "cppa/io/datagram_source_handle.hpp"
#include "cppa/detail/tbind.hpp" #include "cppa/detail/tbind.hpp"
#include "cppa/detail/type_list.hpp" #include "cppa/detail/type_list.hpp"
...@@ -204,24 +201,6 @@ inline bool operator!=(const new_data_msg& lhs, const new_data_msg& rhs) { ...@@ -204,24 +201,6 @@ inline bool operator!=(const new_data_msg& lhs, const new_data_msg& rhs) {
return !(lhs == rhs); return !(lhs == rhs);
} }
/**
* @brief Signalizes a newly arrived datagram for a {@link broker}.
*/
struct new_datagram_msg {
/**
* @brief Handle to the related datagram source.
*/
io::datagram_source_handle handle;
/**
* @brief Handle to the sender of this datagram.
*/
io::datagram_endpoint endpoint;
/**
* @brief Buffer containing the received data.
*/
std::vector<char> buf;
};
/** /**
* @brief Signalizes that a {@link broker} connection has been closed. * @brief Signalizes that a {@link broker} connection has been closed.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment