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: Tue, 17 Feb 2009 10:57:37 -0500

> 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" <address@hidden>
To: "Mailing list for lwIP users" <address@hidden>
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
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>





reply via email to

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