1 package net.matuschek.http.connection; 2 3 6 7 import java.io.IOException ; 8 import java.net.InetAddress ; 9 10 18 public abstract class HttpConnectionPool { 19 20 21 private static int DEFAULT_TIMEOUT = 60000; 22 23 24 HttpConnection connections[]; 25 26 27 int connectionTimeout = DEFAULT_TIMEOUT; 28 29 34 public HttpConnectionPool(int maxConnections) { 35 connections = new HttpConnection[maxConnections]; 36 } 37 38 39 43 public void setConnectionTimeout(int connectionTimeout) { 44 this.connectionTimeout = connectionTimeout; 45 } 46 47 48 52 public int getConnectionTimeout() { 53 return this.connectionTimeout; 54 } 55 56 57 68 public abstract HttpConnection 69 getConnection(InetAddress addr, int port) 70 throws IOException ; 71 72 73 76 public abstract void giveback(HttpConnection conn); 77 } 78 | Popular Tags |