You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by og...@apache.org on 2003/11/25 00:14:33 UTC
cvs commit: jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/server SimpleHttpServer.java
oglueck 2003/11/24 15:14:33
Modified: httpclient/src/test/org/apache/commons/httpclient/server
Tag: HTTPCLIENT_2_0_BRANCH SimpleHttpServer.java
Log:
Added support for systems with more than one network interface.
Revision Changes Path
No revision
No revision
1.1.2.4 +12 -6 jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/server/Attic/SimpleHttpServer.java
Index: SimpleHttpServer.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/server/Attic/SimpleHttpServer.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- SimpleHttpServer.java 24 Nov 2003 20:41:11 -0000 1.1.2.3
+++ SimpleHttpServer.java 24 Nov 2003 23:14:33 -0000 1.1.2.4
@@ -119,13 +119,21 @@
}
/**
- * Returns the TCP port on which this HTTP server instance is bound to.
+ * Returns the TCP port that this HTTP server instance is bound to.
*
* @return TCP port, or -1 if not running
*/
public int getLocalPort() {
return server.getLocalPort();
}
+
+ /**
+ * Returns the IP address that this HTTP server instance is bound to.
+ * @return String representation of the IP address or <code>null</code> if not running
+ */
+ public String getLocalAddress() {
+ return server.getInetAddress().getHostAddress();
+ }
/**
* Checks if this HTTP server instance is running.
@@ -202,8 +210,6 @@
conn.connectionClose();
ErrorResponse.getInstance().getResponse(HttpStatus.SC_SERVICE_UNAVAILABLE).processRequest(conn);
}
-
- conn.getWriter().flush();
}
public void run() {
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org