lwip-users
[Top][All Lists]
Advanced

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

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


From: Francois Bouchard
Subject: Re: [lwip-users] netbuf_data() netconnwrite() problem
Date: Mon, 16 Feb 2009 11:49:36 -0500

Ok, I think that the cast is the good thing to do (I got exemple that does that). 
 
But that does'nt fix my problem.  The client application sends 10 unsigned short, then the server is supposed to send back the 10 u16_t var, but it retransmits half of the data.  The length of the pBuf is 10; but is it 10 octets?  If so that is why I get half of my data back.
 
Hope it's not confusing
 
Francois 
 
----- Original Message -----
Sent: Friday, February 13, 2009 3:49 PM
Subject: [lwip-users] netbuf_data() netconnwrite() problem

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
 


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users

reply via email to

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