pivotal-jbarrett commented on a change in pull request #630:
URL: https://github.com/apache/geode-native/pull/630#discussion_r466748099



##########
File path: cppcache/src/TcpConn.cpp
##########
@@ -318,14 +237,35 @@ size_t TcpConn::socketOp(TcpConn::SockOp op, char *buff, 
size_t len,
     return totalsend;
   }
 }
+ssize_t TcpConn::doOperation(const TcpConn::SockOp& op, void* buff,
+                             size_t sendlen, ACE_Time_Value& waitTime,
+                             size_t& readLen) const {
+  if (op == SOCK_READ) {
+    return stream_->recv_n(buff, sendlen, &waitTime, &readLen);
+  } else {
+    return stream_->send_n(buff, sendlen, &waitTime, &readLen);
+  }
+}
 
 //  Return the local port for this TCP connection.
 uint16_t TcpConn::getPort() {
   ACE_INET_Addr localAddr;
-  m_io->get_local_addr(localAddr);
+  stream_->get_local_addr(localAddr);
   return localAddr.get_port_number();
 }
 
+size_t TcpConn::getDefaultChunkSize() {
+  //
+  auto pageSize = boost::interprocess::mapped_region::get_page_size();
+  if (pageSize > 16000000) {
+    return 16000000;
+  } else if (pageSize > 0) {
+    return pageSize + (16000000 / pageSize) * pageSize;
+  }
+
+  return 16000000;

Review comment:
       Yeah, I didn't want to mess with it. We could through the comment back 
in but I felt it was an inaccurate statement. Clearly it was picking something 
at the os page size given the method name it was calling, but the other magic 
going on didn't. Lacking interest to write a benchmark and test around the 
change to pull it I just left the code.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to