27 , partial_recv_remaining_(0)
28 , partial_recv_ptr_(0)
36 VDBG((
LM_DEBUG,
"(%P|%t) ShmemReceiveStrategy::read link %@ " 37 "resuming partial recv\n",
link_));
50 "peer allocator not found, receive_bytes will close link\n",
72 VDBG((
LM_DEBUG,
"(%P|%t) ShmemReceiveStrategy::read link %@ " 73 "reading at control block #%d\n",
88 "(%P|%t) ShmemReceiveStrategy::receive_bytes link %@\n",
link_));
95 VDBG_LVL((
LM_DEBUG,
"(%P|%t) ShmemReceiveStrategy::receive_bytes closing\n"),
103 const char* src_iter;
112 dst_iter = (
char*)iov[0].iov_base;
118 if (static_cast<size_t>(iov[0].iov_len) <= hdr_sz) {
120 "receive buffer of length %d is too small\n",
126 VDBG((
LM_DEBUG,
"(%P|%t) ShmemReceiveStrategy::receive_bytes " 132 if (static_cast<size_t>(iov[0].iov_len) > hdr_sz) {
133 dst_iter = (
char*)iov[0].iov_base + hdr_sz;
135 dst_iter = (
char*)iov[1].iov_base;
140 for (; i < n && remaining; ++i) {
141 const size_t space = (i == 0) ? iov[i].iov_len - total : iov[i].iov_len,
142 chunk = std::min(space, remaining);
144 #ifdef OPENDDS_SHMEM_WINDOWS 145 if (alloc->
memory_pool().remap((
void*)(src_iter + chunk - 1)) == -1) {
147 "shared memory pool couldn't be extended\n"), 0);
153 std::memcpy(dst_iter, src_iter, chunk);
155 dst_iter = (
char*)iov[i + 1].iov_base;
165 VDBG((
LM_DEBUG,
"(%P|%t) ShmemReceiveStrategy::receive_bytes " 166 "receive was partial\n"));
172 VDBG((
LM_DEBUG,
"(%P|%t) ShmemReceiveStrategy::receive_bytes " DataSampleHeader header_
The demarshalled sample header.
virtual void stop_i()
Let the subclass stop.
char message_id_
The enum MessageId.
static ACE_UINT32 get_length(const char *marshaled_transport_header)
int data_received(ReceivedDataSample &sample, const GUID_t &readerId=GUID_UNKNOWN)
int find(const char *name, void *&pointer)
std::string local_address()
ShmemAllocator * peer_allocator()
virtual void deliver_sample(ReceivedDataSample &sample, const ACE_INET_Addr &remote_address)
Called when there is a ReceivedDataSample to be delivered.
ShmemReceiveStrategy(ShmemDataLink *link)
Holds a data sample received by the transport.
void control_received(ReceivedDataSample &sample)
char transport_header_[TRANSPORT_HDR_SERIALIZED_SZ]
ACE_Based_Pointer_Basic< char > payload_
virtual ssize_t receive_bytes(iovec iov[], int n, ACE_INET_Addr &remote_address, ACE_HANDLE fd, bool &stop)
Only our subclass knows how to do this.
ShmemData * current_data_
virtual int start_i()
Let the subclass start.
void request_ack_received(ReceivedDataSample &sample)
bool gracefully_disconnected_
Flag indicates if the GRACEFUL_DISCONNECT message is received.
const char * partial_recv_ptr_
int handle_dds_input(ACE_HANDLE fd)
#define VDBG_LVL(DBG_ARGS, LEVEL)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
The Internal API and Implementation of OpenDDS.
size_t partial_recv_remaining_
MEMORY_POOL & memory_pool(void)