lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Issues receiving streaming data


From: JM
Subject: [lwip-users] Issues receiving streaming data
Date: Thu, 30 Jul 2009 05:26:26 -0700 (PDT)

I'm using lwIP in raw mode to receive streaming data.  It's Shoutcast streaming audio, so what basically happens is I send a HTTP "get", and the server starts sending data.  All lwIP has to do is ACK.  The application doesn't have to send anything else.  Right now, I'm just throwing away all received packets for testing purposes.  The code I'm using is below.  tcp_recv() has been used to specify "newdata" as the callback.  I'm using tcp_err() to try and trap errors, but there aren't any.  Also, "newdata" isn't being passed any errors. 

Also below are the #defines in lwipopt.h.  I'm a little confused as to the exact meaning of some of the memory options, mainly the ones that opt.h describes as being for sending data.  In my application, I have to send very little data.  They are short packets, and very infrequent.  I'm also trying to keep RAM usage as low as possible as I only have 64K on a Luminary ARM micro.

I've included two Wireshark captures in an attached .zip file (please add .zip to filename).  The one labeled "lan" is when the server was my computer on my LAN, and the one labeled "wan" is a streaming audio server on the Internet.  I've verified these both work fine when a computer is is playing the stream.  On the "lan" trace, there is a perfectly repeated Dup ACK and retransmission that should not be happening.  On the "wan" trace, the connection just seems to break down before I close it.  This is similar behavior to all other Internet streaming audio servers, so it's not just this one. 

I'm at my wits' end on this.  It must be something simple I'm missing.  I've tried defining LWIP_PLATFORM_DIAG to send debug output through the UART, but I get tons of compile errors because it doesn't seem to like the text strings (I am using sprintf).  Any help would be appreciated.

err_t newdata(void *arg, struct tcp_pcb *pcb, struct pbuf *buf, err_t err)
{
    tcp_recved(pcb, buf->tot_len);
    pbuf_free(buf);
    return 0;
}

#define NO_SYS        1
#define MEM_SIZE    2048
#define TCP_WND 1460*2
#define MEMP_NUM_PBUF    1
#define PBUF_POOL_SIZE    3
#define LWIP_NETCONN 0
#define LWIP_SOCKET 0
#define LWIP_TCP 1
#define MEM_ALIGNMENT 4
#define MEMP_NUM_TCP_PCB 1
#define MEMP_NUM_TCP_PCB_LISTEN 0
#define MEMP_NUM_TCP_SEG 2
#define ARP_TABLE_SIZE 1
#define IP_FRAG 0
#define MEMP_NUM_REASSDATA 0
#define LWIP_UDPLITE 1
#define SYS_STATS 0
#define ARP_QUEUEING 0
#define IP_REASSEMBLY    0
#define LWIP_RAW 0
#define TCP_MAXRTX    5
#define TCP_SYNMAXRTX    3
#define TCP_MSS        1460
#define TCP_SND_BUF 1460
#define LWIP_STATS    0

Attachment: wireshark
Description: Binary data


reply via email to

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