Git Product home page Git Product logo

Comments (5)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 17, 2024
Thanks for the info and patch; before I commit the patch, I just want to 
quickly look  
into how DataAvailable behaves with respect to buffering - i.e. is it likely to 
incorrectly thing it has the end of the batch, when actually some is still 
buffered 
at the client.
For info - one option for network usage is the "...WithLengthPrefix" methods 
(in the 
HEAD, but maybe not in the downloadable dll) - this sends the length of each 
batch 
first, which makes network usage very simple: it knows it is expecting <x> 
bytes, so 
it stops cleanly after <x> bytes (see the QuickStart project for an example).

Thanks again - I may well end up applying that patch (once I have checked how 
it 
behaves: I'll be honest - raw sockets isn't my usual thing...).

Marc

Original comment by marc.gravell on 3 Oct 2008 at 6:02

  • Changed state: Started

from protobuf-net.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 17, 2024
I've done some checking, and general consensus is that DataAvailable cannot be 
used 
(robustly) to prove that the batch is complete; it simply indicates that the 
receive 
buffer is empty, which isn't the same thing: if this happens to fall at the 
point  
between fields, then data corruption will occur.

The recommendation given was to use a length-prefix if working with batches, 
which is 
what the QuickStart already does. Of course, if you are just sending one batch 
you 
can serialize and Close() the stream, which will work just as well - but if you 
want 
a dialogue over the socket it should use a length prefix.

If I've got it wrong, please say...

Original comment by marc.gravell on 3 Oct 2008 at 7:46

  • Changed state: WontFix
  • Added labels: Type-Other
  • Removed labels: Type-Defect

from protobuf-net.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 17, 2024
Thanks for looking into it.  I didn't try the WithLengthPrefix methods, as it 
wasn't
in revision 164, and i just updated to 171 to see if the bug I was experiencing 
was
fixed in the newer version...  Tested again with these methods and it works.

Original comment by [email protected] on 3 Oct 2008 at 9:44

from protobuf-net.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 17, 2024
You are right, of course - it [a conversation over a NetworkStream] simply 
didn't 
work in r164, which I found when putting together the quick start example; 
these 
methods were added exactly to fill this gap.

Any other problems, let me know.

Marc

Original comment by marc.gravell on 4 Oct 2008 at 8:24

from protobuf-net.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 17, 2024

Original comment by marc.gravell on 8 Nov 2008 at 9:27

  • Changed state: Verified

from protobuf-net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.