Single instance HTTP Server using WiFly Interface.

Dependents:   WiFlyHTTPServerSample MultiThreadingHTTPServer

Embed: (wiki syntax)

« Back to documentation index

HTTPConnection Class Reference

class HTTPConnection, encapsulates one connection being made throught the HTTPServer More...

#include <HTTPConnection.h>

Data Structures

struct  HTTPMessage
 HTTPMessage contains all the details of the request received by external HTTP client. More...

Public Member Functions

 HTTPConnection ()
 Public constructor for HTTPConnection objects.
 ~HTTPConnection ()
 Destructor for HTTPConnection objects.
bool is_closed ()
 Query if this connection is already closed and can be deleted.

Protected Member Functions

void close ()
 Function to close this connection.
int parse (char *buffer)
 parse a HTTP request line from the content of the buffer.
int parseUriArgs (char *uri_string, map< string, string > &args)
 parse the receoved uri_string for arguments which will be stored in the args map.

Detailed Description

class HTTPConnection, encapsulates one connection being made throught the HTTPServer

Definition at line 50 of file HTTPConnection.h.


Constructor & Destructor Documentation

Public constructor for HTTPConnection objects.

Definition at line 31 of file HTTPConnection.cpp.

Destructor for HTTPConnection objects.

Definition at line 36 of file HTTPConnection.cpp.


Member Function Documentation

void close (  ) [protected]

Function to close this connection.

To be called from internally.

Definition at line 41 of file HTTPConnection.cpp.

bool is_closed (  )

Query if this connection is already closed and can be deleted.

Returns:
true, if connection is closed.
int parse ( char *  buffer ) [protected]

parse a HTTP request line from the content of the buffer.

Parameters:
buffer: the request received from the client in the form <RequestType> <uri> <Http version>="">
Returns:
-1 if the request is invalid or 0 if the request is valid

Definition at line 46 of file HTTPConnection.cpp.

int parseUriArgs ( char *  uri_string,
map< string, string > &  args 
) [protected]

parse the receoved uri_string for arguments which will be stored in the args map.

uri_string : the uri string which was received from the client. args : the args map which will receive the argument:value touples from the uri_string.

Returns:
-1 if an error occured, otherwise returns 0.

Definition at line 91 of file HTTPConnection.cpp.