aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/tcp_posix.cc
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2018-08-16 11:08:00 -0700
committerGravatar Yash Tibrewal <yashkt@google.com>2018-08-16 11:08:00 -0700
commit052beefdec5d84ddd329e702ccb06fc0139a17b2 (patch)
treee7f0d2ee658067745505eb0f75c1c7e9243396f4 /src/core/lib/iomgr/tcp_posix.cc
parentb49f47d4f26b48392950029762cd33e6365657c6 (diff)
Add further comments
Diffstat (limited to 'src/core/lib/iomgr/tcp_posix.cc')
-rw-r--r--src/core/lib/iomgr/tcp_posix.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc
index 6d4c096217..8a479d2ccc 100644
--- a/src/core/lib/iomgr/tcp_posix.cc
+++ b/src/core/lib/iomgr/tcp_posix.cc
@@ -120,7 +120,7 @@ struct grpc_tcp {
* requirement from the TCP endpoint layer is that this arg should be non-null
* if the user wants timestamps for the write. */
void* outgoing_buffer_arg;
- /* Current TCP relative sequence number as defined in RFC 793. Used for
+ /* Current TCP (relative) sequence number which starts out at zero. Used for
* timestamping traced buffers. */
int bytes_counter;
bool socket_ts_enabled; /* True if timestamping options are set on the socket
@@ -576,6 +576,7 @@ static bool tcp_write_with_timestamps(grpc_tcp* tcp, struct msghdr* msg,
}
tcp->socket_ts_enabled = true;
}
+ /* Set control message to indicate that you want timestamps. */
union {
char cmsg_buf[CMSG_SPACE(sizeof(uint32_t))];
struct cmsghdr align;
@@ -594,6 +595,7 @@ static bool tcp_write_with_timestamps(grpc_tcp* tcp, struct msghdr* msg,
GRPC_STATS_INC_SYSCALL_WRITE();
length = sendmsg(tcp->fd, msg, SENDMSG_FLAGS);
} while (length < 0 && errno == EINTR);
+ /* If there was an error on sendmsg the logic in tcp_flush will handle it. */
*sent_length = length;
/* Only save timestamps if all the bytes were taken by sendmsg. */
if (sending_length == static_cast<size_t>(length)) {