Package org.cybergarage.http
Class HTTPServer
java.lang.Object
org.cybergarage.http.HTTPServer
- All Implemented Interfaces:
Runnable
This class identifies an HTTP over TCP server
The server must be initialized iether by the
Optionally a set of
The server then can be started or stopped by the method
The server must be initialized iether by the
open(InetAddress, int)
or the open(String, int)
method.Optionally a set of
HTTPRequestListener
may be setThe server then can be started or stopped by the method
start()
and stop()
- Version:
- 1.8
- Author:
- Satoshi "skonno" Konno, Stefano "Kismet" Lenzi
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaccept()
void
addRequestListener
(HTTPRequestListener listener) boolean
close()
int
static String
getName()
int
Get the current socket timeoutboolean
isOpened()
boolean
boolean
open
(InetAddress addr, int port) void
performRequestListener
(HTTPRequest httpReq) void
removeRequestListener
(HTTPRequestListener listener) void
run()
void
setTimeout
(int timeout) Set the current socket timeoutboolean
start()
boolean
stop()
toString()
I2P
-
Field Details
-
NAME
- See Also:
-
VERSION
- See Also:
-
DEFAULT_PORT
public static final int DEFAULT_PORT- See Also:
-
DEFAULT_TIMEOUT
public static final int DEFAULT_TIMEOUTDefault timeout connection for HTTP comunication- Since:
- 1.8
- See Also:
-
timeout
protected int timeoutStore the current TCP timeout value The variable should be accessed by getter and setter metho
-
-
Constructor Details
-
HTTPServer
public HTTPServer()
-
-
Method Details
-
getName
-
getServerSock
-
getBindAddress
-
getBindPort
public int getBindPort() -
getTimeout
public int getTimeout()Get the current socket timeout- Since:
- 1.8
-
setTimeout
public void setTimeout(int timeout) Set the current socket timeout- Parameters:
timeout
-- Since:
- 1.8
-
open
-
open
-
close
public boolean close() -
accept
-
isOpened
public boolean isOpened() -
addRequestListener
-
removeRequestListener
-
performRequestListener
-
run
public void run() -
start
public boolean start() -
stop
public boolean stop() -
toString
I2P
-