P
Paul Steele
I am writing a client/server application that communicates over tcp. The
code I use to initiate the connection is as follows:
NetworkStream networkStream = new NetworkStream(ClientSocket);
toClient = new BinaryWriter(networkStream);
fromClient = new BinaryReader(networkStream);
There is similar code on the client side. This set up works fine and
communication does occur. However, the communication is very slow. This is
especially noticable if I transfer larger amounts of data such as a file.
If I change the code around and use StreamReader/StreamWriter, performance
is significantly faster. I suspect it's some kind of buffering issue. Any
suggestions would be appreciated.
code I use to initiate the connection is as follows:
NetworkStream networkStream = new NetworkStream(ClientSocket);
toClient = new BinaryWriter(networkStream);
fromClient = new BinaryReader(networkStream);
There is similar code on the client side. This set up works fine and
communication does occur. However, the communication is very slow. This is
especially noticable if I transfer larger amounts of data such as a file.
If I change the code around and use StreamReader/StreamWriter, performance
is significantly faster. I suspect it's some kind of buffering issue. Any
suggestions would be appreciated.