• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

TCP\IP communication

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic