> The other thing that makes me slightly nervous is the use of
> NETCONN_NOCOPY.  How/when are you freeing inbuf?

    I'm doing a netbuf_delete after each receive. Grosso modo:

          inbuf = netconn_recv(conn);
               if (no errors)
                    netconn_write()
               else
                    netconn_close()
          netbuf_delete(inbuf);

> How is the client sending the ushorts?  If it does, for example, 10
> separate writes, you might receive them as 10 separate receives.  This
> might explain why a string works and the ushorts don't as I'd expect the
> client to send the string in a single write.  Of course if you're using
> TCP the network stack is free to segment and combine application writes
> into whatever blocks it likes, so you can't assume that you'll receive
> the data in the same blocks it was sent in.

I'm not shure, the client test application uses  SendBuf(void *Buf, int
BufSize, int Flags = 0)  of VCL TBaseSocket lib, with Borland C++.  I guess
its a single write.

Many Thanks,

PS. how suitable is the netconn_* API  for multi-connexion socket?

Francois



----- Original Message -----
From: "Kieran Mansley" <[email protected]>
To: "Mailing list for lwIP users" <[email protected]>
Sent: Tuesday, February 17, 2009 6:39 AM
Subject: Re: [lwip-users] netbuf_data() netconnwrite() problem


> On Mon, 2009-02-16 at 14:42 -0500, Francois Bouchard wrote:
> > This code works for a string ie. it sends exactly the same thing.  But
for
> > ushorts I can't manage them.  Maybe I'll stick to strings ... and change
the
> > client test program.
>
> How is the client sending the ushorts?  If it does, for example, 10
> separate writes, you might receive them as 10 separate receives.  This
> might explain why a string works and the ushorts don't as I'd expect the
> client to send the string in a single write.  Of course if you're using
> TCP the network stack is free to segment and combine application writes
> into whatever blocks it likes, so you can't assume that you'll receive
> the data in the same blocks it was sent in.
>
> The other thing that makes me slightly nervous is the use of
> NETCONN_NOCOPY.  How/when are you freeing inbuf?
>
> Thanks
>
> Kieran
>
>
>
> _______________________________________________
> lwip-users mailing list
> [email protected]
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>



_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to