|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.cybergarage.http.HTTPServer
public class HTTPServer
This class identifies an HTTP over TCP server
The server must be initialized iether by the open(InetAddress, int)
or the open(String, int)
method.
Optionally a set of HTTPRequestListener
may be set
The server then can be started or stopped by the method start()
and stop()
Field Summary | |
---|---|
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 Summary | |
---|---|
HTTPServer()
|
Method Summary | |
---|---|
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()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public HTTPServer()
Method Detail |
---|
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 void run()
run
in interface Runnable
public boolean start()
public boolean stop()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |