public class HTTPServer extends Object implements Runnable
open(InetAddress, int)
or the open(String, int)
method.HTTPRequestListener
may be setstart()
and stop()
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_PORT |
static int |
DEFAULT_TIMEOUT
Default timeout connection for HTTP comunication
|
static String |
NAME |
protected int |
timeout
Store the current TCP timeout value
The variable should be accessed by getter and setter metho
|
static String |
VERSION |
Constructor and Description |
---|
HTTPServer() |
Modifier and Type | Method and Description |
---|---|
Socket |
accept() |
void |
addRequestListener(HTTPRequestListener listener) |
boolean |
close() |
String |
getBindAddress() |
int |
getBindPort() |
static String |
getName() |
ServerSocket |
getServerSock() |
int |
getTimeout()
Get the current socket timeout
|
boolean |
isOpened() |
boolean |
open(InetAddress addr,
int port) |
boolean |
open(String addr,
int port) |
void |
performRequestListener(HTTPRequest httpReq) |
void |
removeRequestListener(HTTPRequestListener listener) |
void |
run() |
void |
setTimeout(int timeout)
Set the current socket timeout
|
boolean |
start() |
boolean |
stop() |
public static final String NAME
public static final String VERSION
public static final int DEFAULT_PORT
public static final int DEFAULT_TIMEOUT
protected int timeout
public static String getName()
public ServerSocket getServerSock()
public String getBindAddress()
public int getBindPort()
public int getTimeout()
public void setTimeout(int timeout)
timeout
- public boolean open(InetAddress addr, int port)
public boolean open(String addr, int port)
public boolean close()
public Socket accept()
public boolean isOpened()
public void addRequestListener(HTTPRequestListener listener)
public void removeRequestListener(HTTPRequestListener listener)
public void performRequestListener(HTTPRequest httpReq)
public boolean start()
public boolean stop()