Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Network Printer  RSS feed

Doug Thomas
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Trying to print to a barcode printer on the network from a WebSphere Server app running on Unix. Following is my print method:

private final void sendToNetworkPrinter(String ipaddress, String port, String printerCommands)
throws JSpaException {

URL printerUrl;
URLConnection printerConnection;

try {
printerConnection = new URL("http://" + ipaddress + ":" + port).openConnection();

Writer out = new BufferedWriter(new OutputStreamWriter(printerConnection.getOutputStream()));
} catch....

When I step through the code, I see on a network monitor that the 'getOutputStream()' results in TCP SYN/ACK messages being exchanged between the server and the printer. But, the short ASCII print command string that the 'write()' method should send does not get sent by the server.

Any ideas?
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!