Can I communicate a PAC device whit a C# program throught sockets?
Protocols and Drivers
Can I communicate a PAC device whit a C# program throught sockets?
ccarranco@ute.edu.ec
01-30-2008, 1:54 PM
I have a c# program that is listening a specifc port (192.168.1.2:11000) and I need to send a string from de PAC device. I have a communication handle configurated (tcp:192.168.1.2:11000) and I am using the next code.
conexion = OpenOutgoingCommunication(socket);
transmision = TransmitString("hello word",socket);
desconexion = CloseCommunication(socket);
But the C# aplication doesn't recive de data correctly. It is like the aplication doesn`t know about the end of the message.
Please help me.
Re: Can I communicate a PAC device whit a C# program throught sockets?
rhernandez
01-31-2008, 1:32 PM
Asuming the C# half is OK:
1. check the return codes (conexion, transmision), they may be giving you some diagnostic.
2. Wait a while before closing the socket, maybe you are not giving the PAC a chance to send the string. In fact do not close it at all, create a loop to keep sending packets for ever.
3. Sniff the tcp packets. Check this URL:
http://www.wireshark.org/
Salu2.