summaryrefslogtreecommitdiff
path: root/gnu/javax/print
diff options
context:
space:
mode:
authorSven de Marothy <sven@physto.se>2006-05-13 15:05:12 +0000
committerSven de Marothy <sven@physto.se>2006-05-13 15:05:12 +0000
commitd0c0e4f96eeedb6055c90ccd179b4a82d23733cc (patch)
treef0fa69fda5c0f911d7a6b96d555c7e1eccef03bb /gnu/javax/print
parent5779f76011ec2c7c10e7fb91765eb8a766f58fb8 (diff)
downloadclasspath-d0c0e4f96eeedb6055c90ccd179b4a82d23733cc.tar.gz
2006-05-13 Sven de Marothy <sven@physto.se>
* gnu/javax/print/ipp/IppRequest.java (send): Set a timeout. * java/awt/print/PrinterJob.java (getPrinterJob): Return a JavaPrinterJob (setPrintService,getPrintService): Implement. * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c: (getPixels): Gtk_threads_enter required. * gnu/java/awt/print/JavaPrinterGraphics.java * gnu/java/awt/print/JavaPrinterJob.java * gnu/java/awt/print/SpooledDocumet.java: New files.
Diffstat (limited to 'gnu/javax/print')
-rw-r--r--gnu/javax/print/ipp/IppRequest.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/gnu/javax/print/ipp/IppRequest.java b/gnu/javax/print/ipp/IppRequest.java
index 8abab5192..ccfa9b272 100644
--- a/gnu/javax/print/ipp/IppRequest.java
+++ b/gnu/javax/print/ipp/IppRequest.java
@@ -119,6 +119,11 @@ public class IppRequest
{
/**
+ * The printer-poll timeout.
+ */
+ private static final int timeout = 1000;
+
+ /**
* Helper class used to write the attributes of a request
* into the supplied data output stream in the correct way.
*
@@ -838,7 +843,12 @@ public class IppRequest
out.flush();
stream.flush();
-
+
+ // Set the connection timeout, for if the printer is offline.
+ // FIXME: The print services polling should probably be done in its
+ // own thread.
+ connection.setConnectTimeout( timeout );
+
int responseCode = responseCode = connection.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK)