lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] How does tcp backlog works?


From: Zhuoran Zhao
Subject: Re: [lwip-users] How does tcp backlog works?
Date: Sat, 18 Jun 2016 23:10:40 -0500

My server and client implementations are briefly listed as below:


void server(void *arg){
  conn = netconn_new(ctxt, NETCONN_TCP);
  netconn_bind(ctxt, conn, NULL, 7);
  netconn_listen(ctxt, conn);
  while (1) {
    /* Grab new connection. */
    err = netconn_accept(ctxt, conn, &newconn);
    /* Process the new connection. */
    if (err == ERR_OK) {        
    }
      /* Close connection and discard connection identifier. */
      netconn_close(ctxt, newconn);
      netconn_delete(ctxt, newconn);
  }
}


void client(void *ctxt)
{
  conn = netconn_new(ctxt, NETCONN_TCP);
  netconn_bind(ctxt, conn, &((ctxt)->ipaddr), 7 );
  err = netconn_connect(ctxt, conn, &((ctxt)->ipaddr_dest), 7);
  while (1) {
    err = netconn_write_partly(ctxt, conn, buf, buf_size, NETCONN_COPY, bytes_written);
    if (err == ERR_OK) 
    {
      netconn_close(ctxt, conn);
      netconn_delete(ctxt, conn);
      break;
    }
  }
}

Any suggestions will be helpful, thanks



2016-06-18 22:34 GMT-05:00 Zhuoran Zhao <address@hidden>:
Hi, all

For research purpose, I have integrated lwip stack into a discrete event OS simulator. I set up my experiments with one server and multiple clients, thus I think I may need the server hold several incoming connections in a backlog queue, and I configured related macros in lwipopts.h as below:

#define TCP_LISTEN_BACKLOG 1 //enable
#define TCP_DEFAULT_LISTEN_BACKLOG 8

However the server can only capture one incoming connections, with all the other clients stuck at function netconn_connect (I am using netconn APIs). 

Anyone knows how is the tcp backlog implemented in lwip? Besides the two macros, is there any other functions (such as timers for re-transmission) that are necessary for the correct functionality of tcp backlog? Any suggestions will be helpful. 


--
Zhuoran Zhao
Computer Engineering Research Center (CERC), University of Texas at Austin, 
Department of Electrical and Computer Engineering, University of Texas at Austin, 
Skype: zhuoran.zhao




--
Zhuoran Zhao
Computer Engineering Research Center (CERC), University of Texas at Austin, 
Department of Electrical and Computer Engineering, University of Texas at Austin, 
Cellphone: (+1)512-751-1819
Email: address@hidden
Skype: zhuoran.zhao


reply via email to

[Prev in Thread] Current Thread [Next in Thread]