• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TCP\IP communication

 
Neeba Rebbaca
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we are RFID printing label through an xml file. The printer will be connected to the n/w. I will send xml file to the printer through Hyperterminal via tcp\ip port and label will be printer.
Here i need to automate the file formation and sending part. Need to create xml file and send it to tcp\ip port where the printer is listening. Problem over here is, xml is created and sent to tcp\ip port but label is not printer. but if the same file save to some local drive and if sent to hyper terminal label is being printed. I just want to ensure whether the xml is sent to the port and the complete file is send. Please someone help me in resolving this issue. TIA.

 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For starters, you should never use Readers or Writers with ports - use Streams instead. I also advise to be explicit about the encoding - the printer may expect data in a particular encoding (instead of whatever the platform default encoding on the machine running this code is - which is what you are currently using).
 
Neeba Rebbaca
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think it uses any encoding technic because i can able to send the same xml which is saved to local drive to tcp\ip via hyper terminal and print. Is there any way to check whether it is posted in tcp\ip sucessfully and complete file reaches to the port?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Transforming character data to binary data -which is what this code does- always involved an encoding, and the difference between this code and whatever that other app does may well be the use of specific encodings.
 
Henry Wong
author
Marshal
Pie
Posts: 21493
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Neeba Rebbaca wrote:I don't think it uses any encoding technic because i can able to send the same xml which is saved to local drive to tcp\ip via hyper terminal and print. Is there any way to check whether it is posted in tcp\ip sucessfully and complete file reaches to the port?


By "port", I am going to assume you mean that the file is transferred to the other machine. The easiest way is to work it into the protocol. Have you application either communicate the size of the transfer, or have some sort of end-of-file indicator. Or course, for the second case, you will need to confirm that the indicator is not part of the file.

Henry
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic