[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] Re: Resolving- sending data from spartan3 to another (David
From: |
devesh |
Subject: |
[lwip-users] Re: Resolving- sending data from spartan3 to another (David Empson & all) |
Date: |
Thu, 5 Feb 2009 12:59:51 +0530 |
Hi,
Thanks for the tricks!
I have resolved my half of the problem of data sending and receiving.
Now I can send at most 1024bytes at a time and can exactly what i
sent. :) Now the code is like:
static err_t client_connected(void *arg, struct tcp_pcb *pcb, err_t err)
{
char LWIP_UNUSED_ARG(arg);
int i;
char test[n+1];
for(i=0;i<n;i++)
{
test[i]='1';
}
test[n-9]='A';
test[n]='\0';
xil_printf("The test is %s \n\r",test);
if (err != ERR_OK)
printf("\nclient_connected(): err argument not set to ERR_OK, but is
value is %d\n", err);
else
{
tcp_sent(pcb, client_sent);
// tcp_write(pcb, string, strlen(string), 0);
tcp_write(pcb, test, n, 1);
}
return err;
}
Now a litlle prob is :- how to send data more than 1024bytes.? andTCP_SND_BUF ?
Here is my lwipopts.h ;
/////////////////////////////
#define MEM_ALIGNMENT 8
#define MEM_SIZE 131072
#define MEMP_NUM_PBUF 16
#define MEMP_NUM_UDP_PCB 4
#define MEMP_NUM_TCP_PCB 32
#define MEMP_NUM_TCP_PCB_LISTEN 8
#define MEMP_NUM_TCP_SEG 256
#define MEM_LIBC_MALLOC 1
#define MEMP_NUM_SYS_TIMEOUT 8
#define PBUF_POOL_SIZE 256
#define PBUF_POOL_BUFSIZE 1600
#define PBUF_LINK_HLEN 16
#define ARP_TABLE_SIZE 10
#define ARP_QUEUEING 1
#define ICMP_TTL 255
#define IP_OPTIONS 0
#define IP_FORWARD 0
#define IP_REASSEMBLY 1
#define IP_FRAG 1
#define IP_REASS_BUFSIZE 5760
#define IP_FRAG_MAX_MTU 1500
#define IP_DEFAULT_TTL 255
#define LWIP_UDP 1
#define UDP_TTL 255
#define LWIP_TCP 1
#define TCP_SND_QUEUELEN 16 * TCP_SND_BUF/TCP_MSS
#define TCP_MSS 1460
#define TCP_SND_BUF 8192
#define TCP_WND 2048
#define TCP_TTL 255
#define TCP_MAXRTX 12
#define TCP_SYNMAXRTX 4
#define TCP_QUEUE_OOSEQ 1
#define CHECKSUM_GEN_TCP 1
#define CHECKSUM_CHECK_TCP 1
#define LWIP_DHCP 0
#define DHCP_DOES_ARP_CHECK true
#define CONFIG_LINKSPEED_AUTODETECT 1
#endif
////////////////////////////
Here #define TCP_SND_BUF 8192
then why only 1024?
Anyways, can I put " tcp_write(pcb, test, n, 1);" in loop, but
conncetion gets closed after sending 1024.
Regards,
devesh
- [lwip-users] Re: Resolving- sending data from spartan3 to another (David Empson & all),
devesh <=