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

Reading and Writing from same network stream

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 on different threads.

Does anyone know if it is possible to read and write to the same stream
using two different streaming object as mentioned here.

John
Jul 21 '05 #1
1 2806
I know you can read on one thread and write on another to same socket.
However, I don't think you can "reliabably" read and write in each thread to
same socket. You don't need to share the stream, create another writer
steam on the other thread to same socket for write only. Does that help?

--
William Stacey, MVP

"John" <no****@SendNoSpamToMe.com> wrote in message
news:uR**************@tk2msftngp13.phx.gbl...
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 on different threads.

Does anyone know if it is possible to read and write to the same stream
using two different streaming object as mentioned here.

John


Jul 21 '05 #2

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

Similar topics

1
by: Daniel | last post by:
System.IO.StreamWriter Close or Flush method to shut down the computer in such a way that just part of the file is written? or an empty file is written? Also if the Close or Flush is to a...
3
by: Nick | last post by:
I have found a class that compresses and uncompresses data but need some help with how to use part of it below is the deflate method which compresses the string that I pass in, this works OK. At...
16
by: Ali | last post by:
Hi I want to write (or read) to a stream, but the data is not byte array I converted the data to byte array manually, but it is very slow, (becuse the data is very large) Is another way for this...
21
by: JoKur | last post by:
Hello, First let me tell you that I'm very new to C# and learning as I go. I'm trying to write a client application to communicate with a server (that I didn't write). Each message from the...
3
by: Adman | last post by:
Hi all. I've done some websearching, and haven't been able to find my question answered, so I thought I'd post. I apologize if this has already been answered. My question seems to be a...
3
by: Alex Clark | last post by:
Hi All, I'm having some problems reading a network stream. I'm writing a lightweight POP client to handle a very specific task, but I keep unexpectedly reaching the end of the datastream when...
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...
3
by: Sir Psycho | last post by:
Hi, For some reason, when i step over this code, it returns the full byte stream im expecting from the server, however when I let it run with no intervention, it only seems to grab a small chunk...
10
by: puzzlecracker | last post by:
Say I want to arrange bytes in the internal buffer in a certain way. I receive those bytes in the socket. One solution is to read in socket in pieces: byte buffer = new byte; int index = 0;...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.