[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] lwip netconn_recv issue
From: |
hongyancl |
Subject: |
[lwip-users] lwip netconn_recv issue |
Date: |
Wed, 1 May 2013 19:38:07 -0700 (PDT) |
hello,
I want to creat one task in ucos with lwip.
Following the code :
static void
udpecho_thread(void *arg)
{
static struct netconn *conn;
static struct netbuf *buf;
static ip_addr_t *addr;
static unsigned short port;
char buffer[4096];
err_t err;
LWIP_UNUSED_ARG(arg);
conn = netconn_new(NETCONN_UDP);
LWIP_ASSERT("con != NULL", conn != NULL);
netconn_bind(conn, NULL, 7);
while (1)
{
err = netconn_recv(conn, &buf);
if (err == ERR_OK)
{
addr = netbuf_fromaddr(buf);
port = netbuf_fromport(buf);
netconn_connect(conn, addr, port);
netbuf_copy(buf, buffer, buf->p->tot_len);
buffer[buf->p->tot_len] = '\0';
netconn_send(conn, buf);
LWIP_DEBUGF(LWIP_DBG_ON, ("got %s\n", buffer));
netbuf_delete(buf);
}
}
}
but,after i creat the task ,my system is dead.
please give me some asvice.
--
View this message in context:
http://lwip.100.n7.nabble.com/lwip-netconn-recv-issue-tp21383.html
Sent from the lwip-users mailing list archive at Nabble.com.
- [lwip-users] lwip netconn_recv issue,
hongyancl <=