lwip-users
[Top][All Lists]
Advanced

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

Re: Re: Re: [lwip-users] will lwip support asyncselect justlikeWSAAsyncS


From: chenyintao
Subject: Re: Re: Re: [lwip-users] will lwip support asyncselect justlikeWSAAsyncSelect
Date: Thu, 7 Apr 2011 09:14:15 +0800

Hi,Simon!
   Thanks for your reply!
   >I'm assuming this is a nonblocking connect?
   yes!      
>      select(65,readset, writeset,errset, 0);
>      for(i=0;i<TCP_CLIENT_LINK_TOTALS;i++)
>      {
>              if (FD_ISSET(clientsocket[i].socket, writeset))
>                  send();
>              if (FD_ISSET(clientsocket[i].socket, readset))
>                 receive();
>      }      
>     }
>    When TCP_CLIENT_LINK_TOTALS  is equal 16,it works well.But when it is
> equal 64,it will cost more than 100 ms  for a socktet to receiver something.


>I wouldn't have thought that the select implementation is the limiting factor 
>here. Are you sure you did not run >into memory limitations somewhere? 
>Specifically, you need to set MEMP_NUM_NETCONN high enough as well as >have 
>enough pbufs, heap memory and tcp segments. Did you check the stats that there 
>is no error (all 'err' >members should be 0)?

>While our select implementation might be somewhat suboptimal, 64 sockets 
>should not be a problem at all. I'll >see if I can write a test for this.
 
 I also have done some tests for this issue.   I edite the "charge" programe so 
that it can  echo  the request of the modbuspoll.the lengthe of the request 
packet data is 12 Bytes,and the one of the echo's is 250 Bytes.I use the 
wireshark to capture the traffics.there is the result.
 If there are 64 active connetions and only 1 connetion has traffics,the ack 
time is among 1~54 ms,and the usual valuse is 2 ms.
 If send a arp begin the first "for" cycle,and   observe the  time between two 
arp packets,the the time is among 1~154ms.
In fact,it is ok if everything is done in my own modbuspoll program and the 
throught may achieve 2000pps.But the actual application is that a 10ms thread 
decide what to send and to see if have something received and other correlative 
process. So,in some case,my modbuspoll will send 64 packets first,then do the 
receive in the next "select".  As the result it is maybe too inefficient.

It must be difficult to understand my application,maybe you can see the program 
for example? Thanks very much.

The file "tcpclient.c" is my test program.the 10ms thread is  just like the 
function  below,of courese  more complex .
void TaskRun(void *pData)
{
    U8 byErr = 0;
    U8 i = 0;
        
   
    while(TRUE)
    {
        pMsg = (U32*) OSQPend(AppArray, 0, &err);//every 10ms
        for(i=0;i<64;i++)
        {
                if(recvflag[i])
                {
                        sendflag[i] = 1;
                        recvflag[i] = 0;
                }
        }
    }  
}



 

Simon
-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users

Attachment: tcpclient.c
Description: Binary data


reply via email to

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