I need to connect over a clear TCP socket connection with a defined IP and port, that is used as an argument when the program is ran. Then once it is connected I need to send a command through and then get a response back from the server. Are there any good tutorials for C# out there for this? All I could find were ones that had port and IP set within the program.
SO I got some of it working, but can't get the input from command line. I need to send data that is inputted and the return a response.
TcpClient client = new TcpClient(hostName, portNumber);
StreamReader sr = new StreamReader(client.GetStream());
StreamWriter sw = new StreamWriter(client.GetStream());
String data = sr.ReadLine();
while (data != null)
{
sw.WriteLine(data);
data = sr.ReadLine();
Console.WriteLine("\nSend: " + data);
}