From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21796 invoked by alias); 25 Jun 2004 16:38:53 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 21785 invoked from network); 25 Jun 2004 16:38:51 -0000 Received: from unknown (HELO mailgw2.fnal.gov) (131.225.111.12) by sourceware.org with SMTP; 25 Jun 2004 16:38:51 -0000 Received: from conversion-daemon.mailgw2.fnal.gov by mailgw2.fnal.gov (iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8 2003)) id <0HZV00701I8456@mailgw2.fnal.gov> (original mail from ksmartin@fnal.gov) for ecos-discuss@sources.redhat.com; Fri, 25 Jun 2004 11:38:51 -0500 (CDT) Received: from [131.225.130.126] (bdeeksm.fnal.gov [131.225.130.126]) by mailgw2.fnal.gov (iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8 2003)) with ESMTP id <0HZV002HEI8RPI@mailgw2.fnal.gov> for ecos-discuss@sources.redhat.com; Fri, 25 Jun 2004 11:38:51 -0500 (CDT) Date: Fri, 25 Jun 2004 16:38:00 -0000 From: "Kevin S. Martin" To: ecos-discuss@sources.redhat.com Message-id: <40DC551B.40607@fnal.gov> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7BIT User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) Subject: [ECOS] DEBUG: Circular MBUF X-SW-Source: 2004-06/txt/msg00262.txt.bz2 I have a application that opens a TCP/IP socket connection and then at 1Hz writes a bunch of data out on that connection. If "bunch" is < 1000 bytes (approx) then everything works fine however when "bunch" > 1000 (i.e. 2000 or 8000+ bytes) then very quickly I get a series of messages on the console like: DEBUG: Circular MBUF 0x004c7e80! DEBUG: Circular MBUF 0x004c8500! DEBUG: Circular MBUF 0x004c7e00! DEBUG: Circular MBUF 0x004c7c80! After I get these messages I assume that the network thread is in an infinite loop because all threads with lower priority never run again and all networking to/from the target stops. I'm using a i386 PCMB target with a fairly recent version of eCos (April 2004) from the CVS repository. Also, I'm using the FreeBSD networking stack. I've tried increasing the amount of memory designated for networking buffers but this didn't help. The code I'm using to open the connection and write is (abbreviated): // open TCP socket if ( (fdListen = socket(AF_INET, SOCK_STREAM, 0)) < 0 ) { perror("can't open stream socket"); exit(1); } // if the packet is "small" don't wait to send it (i.e. send it now) if( setsockopt( fdListen, IPPROTO_TCP, TCP_NODELAY, (char *)&yes, sizeof(yes) ) == -1 ) { perror("setsockopt:TCP_NODELAY"); exit(1); } // lose the pesky "address already in use" error message if (setsockopt(fdListen, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) == -1) { perror("setsockopt:SO_REUSEADDR"); exit(1); } // bind our local address so client can connect to us bzero( &serv_addr, sizeof(serv_addr) ); serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = INADDR_ANY; serv_addr.sin_port = htons(TCP_PORT1_TO_USE); if ( (reterr = bind(fdListen, (struct sockaddr *)&serv_addr, sizeof(serv_addr))) < 0 ) { perror("can't bind local address"); exit(1); } // listen if (listen(fdListen, 1) == -1) { perror("listen"); exit(1); } addrlen = sizeof(cli_addr); // main loop for(;;) { // handle new connections if ((newfd = accept(fdListen, (struct sockaddr *)&cli_addr, &addrlen)) == -1) { perror("accept"); } else { debug_printf("\nnew connection from %s on socket %d", inet_ntoa(cli_addr.sin_addr), newfd); debug_printf("\nFeed is ON"); while () { . . . if ((nwritten = write(newfd,buffer,size)) < 0) { perror("\nwrite()"); break; } . . . cyg_thread_delay(100); // delay for one second } debug_printf("\nFeed is OFF."); close(newfd); // bye! } } Any ideas? Thanks, Kevin -- Kevin S. Martin Fermi National Accelerator Laboratory Accelerator Division, EE Support Department 630.840.2983 ksmartin@fnal.gov -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss