tdignan87
Well-known member
- Joined
- Jul 8, 2019
- Messages
- 95
- Programming Experience
- Beginner
Hi
I am currently using socket programming to send commands to a device and it sends reply commands.
How can i get the console to read the reply thats returned?
So far i have
able to connect successfully and then im sending
I should be receiving <ESC> H <CR><LF> back but how do i get console to listen, and show replies
Once i have the H back i want to be able to send another command after that
Appreciate any help (new to socketing)
Thanks
Tom
I am currently using socket programming to send commands to a device and it sends reply commands.
How can i get the console to read the reply thats returned?
So far i have
C#:
m_socClient = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
System.Net.IPAddress remoteIPAddress = System.Net.IPAddress.Parse(DatalogicIP);
System.Net.IPEndPoint remoteEndPoint = new System.Net.IPEndPoint(remoteIPAddress, DatalogicPort);
m_socClient.Connect(remoteEndPoint);
Console.WriteLine("Connection Successful");
Console.ReadLine();
able to connect successfully and then im sending
C#:
string hostMode = "<ESC>[C";
C#:
byte[] byData = System.Text.Encoding.ASCII.GetBytes(hostMode);
m_socClient.Send(byData);
I should be receiving <ESC> H <CR><LF> back but how do i get console to listen, and show replies
Once i have the H back i want to be able to send another command after that
Appreciate any help (new to socketing)
Thanks
Tom