473,386 Members | 1,712 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,386 software developers and data experts.

stream associate with socket; will one end block another

Hi,

As I remember theare are In and Out stream associate with a socket.
TcpClient seems there in only one NetworkStream to do both read and write.

Then will it be a conflicit if both side try to send data?

And when one end is sending data, if another end is not calling Recevive or
BeginReceive, will the sender be blocked? Or recevier side network hardware
will read anyway, just our high-end application has not take the data yet?

BTW, if one side use sychronous/asychronous way to receive and send, the
anthoer side does not have to be same, right?

Thanks a lot!
Ryan
Dec 23 '06 #1
1 1292
| As I remember theare are In and Out stream associate with a socket.
| TcpClient seems there in only one NetworkStream to do both read and write.

TCP is a implicit stream. .Net can suface that stream with the
NetworkStream Stream class, however you don't have to use it and can use raw
read/write methods on the socket.

| Then will it be a conflicit if both side try to send data?

Not really. But it could be a problem if your application protocol does not
expect that.

| And when one end is sending data, if another end is not calling Recevive
or
| BeginReceive, will the sender be blocked?

No. Both sides can send or receive at same time. If one side does not take
data fast enouph, the sender could eventually block because of no more
buffer space on receive end.

| Or recevier side network hardware
| will read anyway, just our high-end application has not take the data yet?

Until buffer space is full.

|
| BTW, if one side use sychronous/asychronous way to receive and send, the
| anthoer side does not have to be same, right?

Each side can do either or both. That is a local design choice.

--wjs
Dec 23 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Daniel T. | last post by:
I have a connected Socket object and I call: socket.getInputStream().read(); Now as I understand it, the above will block until some data is received or the socket is closed. In the later...
1
by: John | last post by:
I have a Socket open to a target system. I get the network stream from the open socket and then create a stream reader and stream writer on this stream. The stream reader and writers are operating...
4
by: Chris Tanger | last post by:
Context: C# System.Net.Sockets Socket created with constructor prarmeters Internetwork, Stream and TCP everything else is left at the default parameters and options except linger may be changed...
3
by: Helge Jensen | last post by:
I am implementing a protocol which transmits messages. The messages are most naturally transferred using the a Stream so the protocol can communicate over serial-ports, network links, .... If...
7
by: simonrigby_uk | last post by:
Hi all, Sorry if this is the incorrect group but I couldn't see anything directly relevant. Can someone confirm for me what happens when two network streams are sent to an application at the...
5
by: ad | last post by:
I used use SharpZipLib to compress files in disk. But now I want to compress stream into another stream in memory(the stream not associated with disk file) My pseudo is: Stream...
5
by: Lee Gillie | last post by:
I am using Cryptography. You can encrypt or decrypt by providing an output stream as a parameter to the CryptoStream constructor. But I need byte arrays, as I am encrypting on the fly to a socket,...
7
by: Ole | last post by:
Hi, I'm going to develop a socket communication between an instrument (running CE 5.0 with Compact Fraework V2) and a PC. As the instrument should only connect to one PC at a time I believe that...
8
by: GiBo | last post by:
Hi! Classic situation - I have to process an input stream of unknown length until a I reach its end (EOF, End Of File). How do I check for EOF? The input stream can be anything from opened file...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...

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.