I have a ‘C# server’ program listening to ‘127.0.0.1’, port 5500, using .NET socket, and i have a corresponding C# client program sending messages to this socket from the same PC. They both work fine.
Now if i run the ‘client’ and ‘server’ programs on seperate PC’s and connect them via a cable connecting their serial ports (RS232), should i make changes to code to make them work ? I am asking since i dont have 2 PC’s to check , but need it to work when deployed.
Thanks.
Well, if both computers have appropriate drivers to treat the serial port as a network connection, it should work without any changes.
Otherwise, you’ll have to use the
SerialPortclass. to explicitly talk over the serial port.You may find it best to abstract your code so that it works over streams – then you can get the stream from a network connection or a serial connection, and most of your code won’t need to change.