Re: NetworkStream Read/Write operations - # bytes read/written.



"Charles" <Charles@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9CB95749-FAC0-4796-A2FC-2A6EA6C880FB@xxxxxxxxxxxxxxxx
Is there a way to find out how many bytes NetworkStream Read/Write
actually
read/wrote when there is an exception (i.e. socket read/write timeout).

For reading, if you don't have a successful call to a receiving function,
you cannot safely expect there to be any data at all.

For writing, the best you can do is have something in your application
protocol in which the recipient can tell you how many bytes it received.
That's not exactly the same as how many bytes are written, but it's the best
you can do. If your application protocol has no way to report the bytes
received at the other end, then you have to assume that the entire write
failed.

Pete


.



Relevant Pages

  • Re: WM_COPYDATA
    ... On the receiving end, assign the text to the Text ... The protocol should focus on the problem domain, ... implementation for pushing images to a server. ... To destroy an object: DESTROY CRLF ...
    (comp.lang.pascal.delphi.misc)
  • Re: How to deal with full-duplex communication?
    ... TCP/IP itself will not and cannot "lose" messages. ... is an error in your protocol. ... completely asynchronously as part of the design. ... At the level of socket io, you cannot really coordinate sending and receiving, ...
    (microsoft.public.vc.mfc)
  • Re: how to synchronize 2 com ports
    ... Then the receiving end must consume the data. ... a SBC, it also sends commands continuously, ... I am stuck at the protocol. ...
    (microsoft.public.vb.controls)
  • Re: Who could tell me about raw socket in winsocket?
    ... there is no defined protocol. ... we send ICMP package or IP package when sending data?We receive ICMP ... package or IP package when receiving data? ...
    (microsoft.public.win32.programmer.networks)
  • Re: net/mpd4: Unable to pass pass traffic as pptp client
    ... through ng0 and then a PPP compressed data packet out em0. ... receiving back a PPP LCP protocol reject from the concentrator back to ... LCP: protocol 0xee0b was rejected ...
    (freebsd-net)