pkarashchenko commented on a change in pull request #5526:
URL: https://github.com/apache/incubator-nuttx/pull/5526#discussion_r809052145



##########
File path: net/tcp/tcp_send_buffered.c
##########
@@ -1172,7 +1204,12 @@ ssize_t psock_tcp_send(FAR struct socket *psock, FAR 
const void *buf,
               goto errout_with_lock;
             }
 
-          net_lockedwait_uninterruptible(&conn->snd_sem);
+          remain = tcp_send_gettimeout(anchor, remain);
+          ret = net_timedwait_uninterruptible(&conn->snd_sem, remain);

Review comment:
       > 1. anchor time should not to be changed on sending process,
   > 
   
   I do not propose to change anchor time on sending process. It will be done 
once. I just used a different name `anchor` -> `start`.
   >     2. remain, anchor, _SO_TIMEOUT(conn->sconn.s_sndtimeo),  these are in 
milliseconds, which will reduce unnecessary type cast
   >
   
   I do not fully understand this. In my proposal I don't think that there are 
additional type casts.
   >     3. what different with current tcp_send_gettimeout ?
   In general I propose to track running time in `clock_t` (the same type that 
is returned by `clock_systime_ticks`) and perform conversion to `ms` only 
inside the `tcp_send_gettimeout` once. This will give better granularity 
compared to current code. Also it will eliminate having `uint32_t remain;` 
inside the `psock_tcp_send`.




-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

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


Reply via email to