473,414 Members | 1,677 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

writing buffers to NetworkStream from TCPClient

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
5 3454
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
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
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
"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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: cmjman | last post by:
I have an issue where networkStream.Write doesn't perform its write downstream from my client program until the network stream is closed. I then see the data that was sent appear on the other side....
1
by: Daniel | last post by:
i would like to konw when the data sent so that i can close the streamwriter and networkstream is there some sort of call backs/events i have to implement for this to work? if so how? can i just...
7
by: Dustin B | last post by:
Since this issue encompasses so many things - I have to generally post it I guess. I'm building an application for a Wireless PDA - when it is connected to the Network I tested a TCPListener &...
1
by: Chin Fui | last post by:
I am now doing my final year project using VB.NET. The project is about implement a multiplayer network game. But now I am stuck in the connection part, no idea in how to start to write the network...
2
by: Dustin Brisebois via DotNetMonster.com | last post by:
This is coming from a Windows 2003 Server to a HP Pocket PC (WinCE 2003) over 802.11b. The device is on the Network and can be pinged, it can write data to the Server stream - but not read the...
7
by: david.topham | last post by:
Hi The code below demostrates an issue I'm having with with NetworkStream: using System; using System.Net.Sockets; namespace TCPCTest { class Class1
1
by: hamid_2020 | last post by:
I wrote a class to connect to a server using tcpclient. I need to connect to the server and the connection must be open.Then i need to send request to the server again and again.But the problem is...
0
by: Al Wilkerson | last post by:
Hey, Has anyone ever got a "Unable to read data from transport connected" message after reading data from a streamreader composed of a networkstream. For example: Server TcpListener...
2
by: PiotrKolodziej | last post by:
Hi I have a simple question. Here is the code related to my question: while (true) { if (tcpListenerServer.Pending() && !this.Disposing) { TcpClient tcpClient =...
5
by: | last post by:
I've got a basic "chat" infrastructure that can send objects across the wire, but I'm running into a few issues with trying to send multiple messages and things behaving differently in debug and...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.