|
楼主 |
发表于 2006-3-24 09:41:06
|
显示全部楼层
我在skyeye的例子里面试着写个UDP的发送程序,然后在linux端接收,不知道为什么却怎么也收不到啊.
static void tcpecho_thread(void *arg)
{
struct netconn *conn;
struct netbuf *buf;
struct ip_addr addr;
char *data;
char text[] = "A static text";
int i;
conn = netconn_new(NETCONN_UDP);
addr.addr = htonl(0x0a000001);
netconn_connect(conn, &addr,8000);
buf = netbuf_new();
//data = netbuf_alloc(buf,10);
//for(i = 0; i < 10; i++)
//data = i;
//netconn_send(conn, buf);
//for(i=0;i<10;i++)
{
netbuf_ref(buf, text, sizeof(text));
netconn_send(conn, buf);
}
netconn_delete(conn);
netconn_delete(buf);
} |
|