0

hi i am new to TCP listening application under c# i manage to make the server listen to a specific port but when the server is about to read the stream it throws NullReferenceException in this code

TcpClient tcpClient = (TcpClient)client;
NetworkStream clientStream = tcpClient.GetStream();

when i run the application all is fine until the server starts to read data

i tried using this code

TcpClient tcpClient = (TcpClient)client;
        NetworkStream clientStream;
        clientStream = tcpClient.GetStream();

but the error is the same

any help will do

thank you

Sriram Sakthivel
  • 72,067
  • 7
  • 111
  • 189
angelogogo
  • 663
  • 4
  • 11
  • 25

0 Answers0