lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: AW: Problem of tcp_write with more then about 20 kBytes


From: Diego
Subject: [lwip-users] Re: AW: Problem of tcp_write with more then about 20 kBytes
Date: Fri, 10 Dec 2010 19:52:46 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

I'm using arm9 with Eclipse(GNU), board at91sam9260!

Maybe the way that I'm using tcp_write is wrong!

part of my lwipopts.h:

/* This is the callback function that is called
when a TCP segment has arrived in the connection. */
static err_t
httpd_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
{

 //    static u32_t reqcount;

    //printf("CB recv %x, %x, %x, %x\n\r", arg, pcb, p, err);
    if (err != ERR_OK) {
        return err;
    }

    /* If we got a NULL pbuf in p, the remote end has closed
    the connection. */
    if(p == NULL) {
        /* Close the connection. */
        tcp_close(pcb);
        return ERR_OK;
    }

        /* The payload pointer in the pbuf contains the data
        in the TCP segment. */

        int len = strlen(p->payload);
        if (len <= 0)
                return ERR_OK;

        char* cmd = p->payload;

        printf("rcv: \""); printf(cmd); printf("\"\n\r");

        if (StartsWith(cmd, "@read") && len >= 21) {

           for (SndPacketCount=0; SndPacketCount < SndPacketTotal; 
SndPacketCount++) {
             getbuffer();
             tcp_write(pcb, SndBuffer, SndBufferLen, 0);
             tcp_output(pcb);
           }
                        
           printf("rd_ok#");
           tcp_write(pcb, "rd_ok#", 6, 0);
        }
}
  
-------------------------------------------------------

I made a program with C# that comunicate with arm through Ethernet, and with uIP
I receive the data in C# application correctly, but with this one, dont work;/

Thanks

Diego






reply via email to

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