lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] netbuf_data() netconnwrite() problem


From: Francois Bouchard
Subject: [lwip-users] netbuf_data() netconnwrite() problem
Date: Fri, 13 Feb 2009 15:49:25 -0500

Hi all,
I got a problem into my code that simply echos any incomming messages. 
First  have to cast (void *) to &buf because my compiler says its an error if I don't.
 
Secundo, the message transmitted by the server seems to be only half the original message length.
 
========================================================
    struct netbuf *inbuf;
    char *buf;
    u16_t buflen;
    err_t socket_error;
 
    inbuf = netconn_recv(conn);
    socket_error = netconn_err(conn);   
    
    if (socket_error == ERR_OK)    
    {
            netbuf_data(inbuf, (void*) &buf, &buflen);
            netconn_write(conn, (void*)buf, buflen, NETCONN_NOCOPY); 
    }
 

==========================================================     
 
See any flaws into the code?
 
Francois
 

reply via email to

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