Re: IwIP
Sergio Pérez <[email protected]>
| Newsgroups | gmane.linux.real-time.rtlinux.general |
|---|---|
| Message-ID | <[email protected]> |
Hi, Xin Wang!!
Two issues:
1.- Have you checked the rtl_lwipopts.h file and tunned it?? Remember that it
has lots of options that may be modified for your system.
If so:
2.- Have you moved to the latest version or RTL-lwIP?? You know, in a porting
of other project the porting itself inherits bugs from the original one.
The 0.5 version of RTL-lwIP is the porting of the latest lwIP version standing
stable(1.0.0). Download it and test it.
I'll try your code in short. Now I'm quite busy. I'll send you my results.
Best regards.
Sergio.
El Sábado, 27 de Noviembre de 2004 06:04, Xin WANG escribió:
> Hi,
> I changed example "tcp_echo_multithread" to test how many sockets i
> can open simultanously. The code is much simipler than it before. It
> does nothing excpet waiting for 4 connections and CLOSING THEM IN
> CLEANUP_MODULE(). The problem is that it takes too long time to accpet
> 3th connection and when i rmmod it prints a lot of p != NULL.Why?
> Thanks!
>
>
> This is my code:
> --------------------------------------------------------------------
> #include <linux/module.h>
> #include <linux/kernel.h>
> #include "lwip/sys.h"
> #include "lwip/api.h"
> #include <rtl_sched.h>
> #include <rtl_debug.h>
>
> #define NUM_OF_CONN 4
> struct netconn *newconn[NUM_OF_CONN];
>
> static void
> tcpecho_thread(void *arg)
> {
> struct netconn *conn;
> int i;
>
> /* Create a new connection identifier. */
> conn = netconn_new(NETCONN_TCP);
>
> /* Bind connection to well known port number 7. */
> netconn_bind(conn, NULL, 7);
>
> /* Tell connection to go into listening mode. */
> netconn_listen(conn);
>
> for(i=0;i<NUM_OF_CONN;i++) {
> newconn[i]=netconn_accept(conn);
> rtl_printf("%d accepted\n", i);
> }
> }
>
> int init_module(void){
> printk("\n Multithreaded TCP echo server inserted\n");
> sys_thread_new(tcpecho_thread, NULL, 0);
> return 0;
> }
>
> void cleanup_module(void){
> int i;
> for(i=0;i<NUM_OF_CONN;i++){
> netconn_close(newconn[i]);
> netconn_delete(newconn[i]);
> }
> printk("\n Multithreaded TCP echo server removed\n");
> }
> _______________________________________________
> Rtl mailing list
> [email protected]
> http://www2.fsmlabs.com/mailman/listinfo/rtl
_______________________________________________
Rtl mailing list
[email protected]
http://www2.fsmlabs.com/mailman/listinfo/rtl