cybergarage-upnp
org.cybergarage.http.HTTPServer Class Reference
Inheritance diagram for org.cybergarage.http.HTTPServer:

Public Member Functions

 HTTPServer ()
 
ServerSocket getServerSock ()
 
String getBindAddress ()
 
int getBindPort ()
 
synchronized int getTimeout ()
 
synchronized void setTimeout (int timeout)
 
boolean open (InetAddress addr, int port)
 
boolean open (String addr, int port)
 
boolean close ()
 
Socket accept ()
 
boolean isOpened ()
 
void addRequestListener (HTTPRequestListener listener)
 
void removeRequestListener (HTTPRequestListener listener)
 
void performRequestListener (HTTPRequest httpReq)
 
void run ()
 
boolean start ()
 
boolean stop ()
 

Static Public Member Functions

static String getName ()
 

Static Public Attributes

static final String NAME = "CyberHTTP"
 
static final String VERSION = "1.0"
 
static final int DEFAULT_PORT = 80
 
static final int DEFAULT_TIMEOUT = DEFAULT_PORT * 1000
 

Protected Attributes

int timeout = DEFAULT_TIMEOUT
 

Private Attributes

ServerSocket serverSock = null
 
InetAddress bindAddr = null
 
int bindPort = 0
 
ListenerList httpRequestListenerList = new ListenerList()
 
Thread httpServerThread = null
 

Detailed Description

This class identifies an HTTP over TCP server
The server must be initialized iether by the HTTPServer#open(InetAddress, int) or the HTTPServer#open(String, int) method.
Optionally a set of HTTPRequestListener may be set
The server then can be started or stopped by the method HTTPServer#start() and HTTPServer#stop()

Author
Satoshi "skonno" Konno
Stefano "Kismet" Lenzi
Version
1.8

Constructor & Destructor Documentation

◆ HTTPServer()

org.cybergarage.http.HTTPServer.HTTPServer ( )
inline

Member Function Documentation

◆ accept()

Socket org.cybergarage.http.HTTPServer.accept ( )
inline

◆ addRequestListener()

void org.cybergarage.http.HTTPServer.addRequestListener ( HTTPRequestListener listener)
inline

◆ close()

boolean org.cybergarage.http.HTTPServer.close ( )
inline

◆ getBindAddress()

String org.cybergarage.http.HTTPServer.getBindAddress ( )
inline

◆ getBindPort()

int org.cybergarage.http.HTTPServer.getBindPort ( )
inline

◆ getName()

static String org.cybergarage.http.HTTPServer.getName ( )
inlinestatic

◆ getServerSock()

ServerSocket org.cybergarage.http.HTTPServer.getServerSock ( )
inline

◆ getTimeout()

synchronized int org.cybergarage.http.HTTPServer.getTimeout ( )
inline

Get the current socket timeout

Since
1.8

◆ isOpened()

boolean org.cybergarage.http.HTTPServer.isOpened ( )
inline

◆ open() [1/2]

boolean org.cybergarage.http.HTTPServer.open ( InetAddress addr,
int port )
inline

◆ open() [2/2]

boolean org.cybergarage.http.HTTPServer.open ( String addr,
int port )
inline

◆ performRequestListener()

void org.cybergarage.http.HTTPServer.performRequestListener ( HTTPRequest httpReq)
inline

◆ removeRequestListener()

void org.cybergarage.http.HTTPServer.removeRequestListener ( HTTPRequestListener listener)
inline

◆ run()

void org.cybergarage.http.HTTPServer.run ( )
inline

◆ setTimeout()

synchronized void org.cybergarage.http.HTTPServer.setTimeout ( int timeout)
inline

Set the current socket timeout

Parameters
longoutnew timeout
Since
1.8

◆ start()

boolean org.cybergarage.http.HTTPServer.start ( )
inline

◆ stop()

boolean org.cybergarage.http.HTTPServer.stop ( )
inline

Field Documentation

◆ bindAddr

InetAddress org.cybergarage.http.HTTPServer.bindAddr = null
private

◆ bindPort

int org.cybergarage.http.HTTPServer.bindPort = 0
private

◆ DEFAULT_PORT

final int org.cybergarage.http.HTTPServer.DEFAULT_PORT = 80
static

◆ DEFAULT_TIMEOUT

final int org.cybergarage.http.HTTPServer.DEFAULT_TIMEOUT = DEFAULT_PORT * 1000
static

Default timeout connection for HTTP comunication

Since
1.8

◆ httpRequestListenerList

ListenerList org.cybergarage.http.HTTPServer.httpRequestListenerList = new ListenerList()
private

◆ httpServerThread

Thread org.cybergarage.http.HTTPServer.httpServerThread = null
private

◆ NAME

final String org.cybergarage.http.HTTPServer.NAME = "CyberHTTP"
static

◆ serverSock

ServerSocket org.cybergarage.http.HTTPServer.serverSock = null
private

◆ timeout

int org.cybergarage.http.HTTPServer.timeout = DEFAULT_TIMEOUT
protected

Store the current TCP timeout value The variable should be accessed by getter and setter metho

◆ VERSION

final String org.cybergarage.http.HTTPServer.VERSION = "1.0"
static

The documentation for this class was generated from the following file: