ANNA Suite  2020b
Multipurpose development suite for Telco applications
Namespaces | Classes | Variables
anna::http Namespace Reference

Namespaces

 parser
 
 wims20
 

Classes

class  EncodedBlock
 
struct  functions
 
class  Handler
 
class  Header
 
class  Message
 
class  MessageFactory
 
class  Method
 
class  Request
 
class  Response
 
class  sccs
 
class  Token
 
class  Tokenizer
 
class  Transport
 
class  Version
 

Variables

const char endOfLine [3]
 
const int sizeEndOfLine
 
const char contentLength [16]
 

Detailed Description

Proporciona los componentes necesarios para la comunicacion entre procesos usando como capa de transporte el protocolo HTTP 1.1 definido en el RFC 2616.

A continacion mostramos la forma en la que se podria definir un ServerSocket que atiende peticiones y/o respuesta sobre el protocolo HTTP.

void MyHTTPServer::initialize ()
noexcept(false)
{
CommandLine& cl (CommandLine::instantiate ());
int port = cl.getIntegerValue ("p");
const comm::Device* device = Network::instantiate ().find (Device::asAddress (cl.getValue ("a")));
a_serverSocket = new ServerSocket (INetAddress (device, port), cl.exists ("r"), &anna::http::Transport::getFactory ());
}

El siguiente ejemplo muestra como podriamos definir un cliente HTTP que realiza las peticiones sobre un servidor HTTP:

void MyHTTPClient::initialize ()
noexcept(false)
{
CommandLine& cl (CommandLine::instantiate ());
Network& network = Network::instantiate ();
Host* host = network.find ("host000");
host->assign (network.find (Device::asAddress (cl.getValue ("a"))));
a_server = host->createServer ("http_server", cl.getIntegerValue ("p"), true, &anna::http::Transport::getFactory ());
}

El ejecutable debera enlazarse con las librerias:

El Packet Header es anna.http.h

Variable Documentation

◆ contentLength

const char anna::http::contentLength[16]

◆ endOfLine

const char anna::http::endOfLine[3]

◆ sizeEndOfLine

const int anna::http::sizeEndOfLine