mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
net/tcp/handshake: send the SYN immediately.
Change-Id: I761cff3b9950b75327fa03fb53b861ea088d8b35 Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
+1
-1
@@ -1283,7 +1283,7 @@ int tcp_connect(FAR struct tcp_conn_s *conn, FAR const struct sockaddr *addr)
|
||||
|
||||
conn->tx_unacked = 1; /* TCP length of the SYN is one. */
|
||||
conn->nrtx = 0;
|
||||
conn->timer = 1; /* Send the SYN next time around. */
|
||||
conn->timer = 0; /* Send the SYN immediately. */
|
||||
conn->rto = TCP_RTO;
|
||||
conn->sa = 0;
|
||||
conn->sv = 16; /* Initial value of the RTT variance. */
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include <nuttx/net/tcp.h>
|
||||
|
||||
#include "devif/devif.h"
|
||||
#include "netdev/netdev.h"
|
||||
#include "socket/socket.h"
|
||||
#include "tcp/tcp.h"
|
||||
|
||||
@@ -322,6 +323,10 @@ int psock_tcp_connect(FAR struct socket *psock,
|
||||
ret = psock_setup_callbacks(psock, &state);
|
||||
if (ret >= 0)
|
||||
{
|
||||
/* Notify the device driver that new connection is available. */
|
||||
|
||||
netdev_txnotify_dev(((FAR struct tcp_conn_s *)psock->s_conn)->dev);
|
||||
|
||||
/* Wait for either the connect to complete or for an error/timeout
|
||||
* to occur. NOTES: net_lockedwait will also terminate if a signal
|
||||
* is received.
|
||||
|
||||
Reference in New Issue
Block a user