I am trying to write a simple chat client and server program, using this link - http://csharp.net-informations.com/communications/csharp-chat-server-programming.htm (2 links to source code for server and client are just under the pictures). But when I try to compile I get an error in this line
serverStream.Write(outStream, 0, outStream.Length);
Here I get below error
NullRefrenceException [Object reference not set to an instance of an object].
but right above I have a line
byte[] outStream = System.Text.Encoding.ASCII.GetBytes(textBox2.Text);
which successfully initializes the outStream. So I'm really not sure of what is causing this, and will be glad if someone could help me.