Socket::~Socket()
{
+ assert(seastar::this_shard_id() == sid);
#ifndef NDEBUG
assert(closed);
#endif
seastar::future<bufferlist>
Socket::read(size_t bytes)
{
+ assert(seastar::this_shard_id() == sid);
#ifdef UNIT_TESTS_BUILT
return try_trap_pre(next_trap_read).then([bytes, this] {
#endif
seastar::future<bufferptr>
Socket::read_exactly(size_t bytes) {
+ assert(seastar::this_shard_id() == sid);
#ifdef UNIT_TESTS_BUILT
return try_trap_pre(next_trap_read).then([bytes, this] {
#endif
seastar::future<>
Socket::write(bufferlist buf)
{
+ assert(seastar::this_shard_id() == sid);
#ifdef UNIT_TESTS_BUILT
return try_trap_pre(next_trap_write
).then([buf = std::move(buf), this]() mutable {
seastar::future<>
Socket::flush()
{
+ assert(seastar::this_shard_id() == sid);
inject_failure();
return inject_delay().then([this] {
return out.flush();
seastar::future<>
Socket::write_flush(bufferlist buf)
{
+ assert(seastar::this_shard_id() == sid);
#ifdef UNIT_TESTS_BUILT
return try_trap_pre(next_trap_write
).then([buf = std::move(buf), this]() mutable {
#endif
}
-void Socket::shutdown() {
+void Socket::shutdown()
+{
+ assert(seastar::this_shard_id() == sid);
socket_is_shutdown = true;
socket.shutdown_input();
socket.shutdown_output();
}
seastar::future<>
-Socket::close() {
+Socket::close()
+{
+ assert(seastar::this_shard_id() == sid);
#ifndef NDEBUG
ceph_assert_always(!closed);
closed = true;
#ifdef UNIT_TESTS_BUILT
void Socket::set_trap(bp_type_t type, bp_action_t action, socket_blocker* blocker_) {
+ assert(seastar::this_shard_id() == sid);
blocker = blocker_;
if (type == bp_type_t::READ) {
ceph_assert_always(next_trap_read == bp_action_t::CONTINUE);
Socket(Socket&& o) = delete;
+ seastar::shard_id get_shard_id() const {
+ return sid;
+ }
+
side_t get_side() const {
return side;
}
}
bool is_shutdown() const {
+ assert(seastar::this_shard_id() == sid);
return socket_is_shutdown;
}
// shutdown for tests
void force_shutdown() {
+ assert(seastar::this_shard_id() == sid);
socket.shutdown_input();
socket.shutdown_output();
}
// shutdown input_stream only, for tests
void force_shutdown_in() {
+ assert(seastar::this_shard_id() == sid);
socket.shutdown_input();
}
// shutdown output_stream only, for tests
void force_shutdown_out() {
+ assert(seastar::this_shard_id() == sid);
socket.shutdown_output();
}