0

I have a VB.NET application that sends through TCP an ASCII string to a JAVA application running on CentOS server and it works ok unless the VB.NET application sends an string containig spaces.

In example if I send this arg0=!X0079 09999 00000 00000 00000 01

In the server JAVA application log say that receives arg0=!X0079 09999= 00000= 01=

But I sniff the data with Wireshark and the data is coming out OK from VB.NET application

The JAVA application is decoding data with this line

String cmd = StringTools.toStringValue(pktBytes);

The upper code line is from Geotelematic Solutions, is not my code.

So, There's any restriction sending spaces to a JAVA application or is something particular with this JAVA application in particular?

E_Blue
  • 1,021
  • 1
  • 20
  • 45
  • This doesn't address your problem directly but, `StringTools.toStringValue` is useless because it requires the sender to know the receiver's platform default encoding instead of it being specified by your protocol. It's probably not what's causing this problem because, whatever the receiver's platform default is, it's probably not incompatible with the ASCII you are sending. You might want to verify with `locale`, though. – Tom Blodget Oct 29 '14 at 21:30
  • Thanks for answering. I make a workaround for this issue. – E_Blue Oct 30 '14 at 13:47

0 Answers0