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

stream associate with socket; will one end block another

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
| 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 discussion thread is closed

Replies have been disabled for this discussion.