By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,002 Members | 1,286 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,002 IT Pros & Developers. It's quick & easy.

writing buffers to NetworkStream from TCPClient

P: n/a
Does one have to adhere to the usual boundaries from the underlying
protocols? What happens when you write a byte[] which is for example 50 kb
to the stream?

Greetz,
-- Rob.
Nov 15 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Rob Tillie <Ro********@student.tul.edu> wrote:
Does one have to adhere to the usual boundaries from the underlying
protocols? What happens when you write a byte[] which is for example 50 kb
to the stream?


That should be fine - each layer will take care of its own difficulties
(splitting it into packets etc) in order to provide the appearance of a
smooth stream.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Nov 15 '05 #2

P: n/a
Kewl !!!
But what happens if I use a raw TCP socket? Then I should take care of the
splitting?
I looked at the MSDN docs, but couldn't find any documentation about this.

Greetz,
-- Rob.

Jon Skeet wrote:
Rob Tillie <Ro********@student.tul.edu> wrote:
Does one have to adhere to the usual boundaries from the underlying
protocols? What happens when you write a byte[] which is for example
50 kb to the stream?


That should be fine - each layer will take care of its own
difficulties (splitting it into packets etc) in order to provide the
appearance of a smooth stream.

Nov 15 '05 #3

P: n/a
Kewl !!!
But what happens if I use a raw TCP socket? Then I should take care of the
splitting?
I looked at the MSDN docs, but couldn't find any documentation about this.

Greetz,
-- Rob.

Jon Skeet wrote:
Rob Tillie <Ro********@student.tul.edu> wrote:
Does one have to adhere to the usual boundaries from the underlying
protocols? What happens when you write a byte[] which is for example
50 kb to the stream?


That should be fine - each layer will take care of its own
difficulties (splitting it into packets etc) in order to provide the
appearance of a smooth stream.

Nov 15 '05 #4

P: n/a
"Rob Tillie" <Ro********@student.tul.edu> wrote in message
news:%2********************@TK2MSFTNGP12.phx.gbl.. .
Kewl !!!
But what happens if I use a raw TCP socket? Then I should take care of the splitting?
I looked at the MSDN docs, but couldn't find any documentation about

this.

Remember, TCP is over IP. So the IP layer should take care of
creating legit IP packets while the TCP layer adds the proper
signaling. So what Jon said applies to sockets just as well as to
streams. There's no way for you to really know how/where to split the
data (without becoming an expert in TCP/IP, ethernet, ATM, DSL, etc.).
Just throw your bytes at the socket and they'll go. That's the beauty
of layers in a protocol.

mike
Nov 15 '05 #5

P: n/a
"Rob Tillie" <Ro********@student.tul.edu> wrote in message
news:%2********************@TK2MSFTNGP12.phx.gbl.. .
Kewl !!!
But what happens if I use a raw TCP socket? Then I should take care of the splitting?
I looked at the MSDN docs, but couldn't find any documentation about

this.

Remember, TCP is over IP. So the IP layer should take care of
creating legit IP packets while the TCP layer adds the proper
signaling. So what Jon said applies to sockets just as well as to
streams. There's no way for you to really know how/where to split the
data (without becoming an expert in TCP/IP, ethernet, ATM, DSL, etc.).
Just throw your bytes at the socket and they'll go. That's the beauty
of layers in a protocol.

mike
Nov 15 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.