I want to create two NetworkStreams objects and i want that one should only support reading operation and the other one only writting operation. This is what i have tried to do but i got the error
NetworkStream nStreamObj1 = new NetworkStream(clientSocket);
NetworkStream nStreamObj2 = new NetworkStream(clientSocket);
nStreamObj1.canRead = true;
nStreamObj1.canWrite = false
nStreamObj1.canRead = false;
nStreamObj1.canWrite = true;
I got the error that CanRead and CanWrite are read-only properties! How can i set if possible those properties ?
Assuming the Socket can read and write, you can try the following:
Edit:
See Remarks section here