Does anyone know what the problem is with this code below? You are giving the following error: "The stream is not writable"
TcpListener tcpl = new TcpListener(500);
tcpl.Start();
Socket sock = tcpl.AcceptSocket();
NetworkStream stream = new NetworkStream(sock);
BinaryWriter write;
while (true)
{
string Resp = string.Format("{0}\n{1}\n{2}",
"HTTP/1.1 890 FOUND",
"",
"<h1>Worked!</h1>"
);
write = new BinaryWriter(stream);
write.Write(Resp);
write.Close();
}
tcpl.Stop();
sock.Close();
stream.Close();