NetSocket++  0.1
A library designed to simplify working with UNIX sockets in C++, written in OOP methodology.
 All Classes Namespaces Files Functions Variables
Public Member Functions | List of all members
NetSocketPP::HTTPClientSocket Class Reference

A class representing HTTP client socket. More...

#include <HTTPClientSocket.h>

Inheritance diagram for NetSocketPP::HTTPClientSocket:
NetSocketPP::ClientSocket NetSocketPP::NetSocket

Public Member Functions

 HTTPClientSocket (std::string host, std::string service, std::string docRequest)
 A constructor with parameters. More...
 
HTTPReply getReply ()
 A function returning a HTTPReply. More...
 
std::string getRequest ()
 A function returning the request used in the socket. More...
 
- Public Member Functions inherited from NetSocketPP::ClientSocket
 ClientSocket (std::string host, std::string service, std::string protocol)
 A constructor with parameters, that creates and connects the socket. More...
 
int send (std::string msg, int flags)
 A function, that sends data through the socket. More...
 
int recv (int flags)
 A function, that receives data through the socket. More...
 
std::string get ()
 A function returning recently recv-d data. More...
 
- Public Member Functions inherited from NetSocketPP::NetSocket
 NetSocket (std::string host, std::string service, std::string protocol)
 A constructor with parameters, that creates a socket. More...
 
std::string getIP ()
 A function that returns IP of a host. More...
 
int getDesc ()
 A function that returns socket descriptor. More...
 
 ~NetSocket ()
 A destructor, that frees the memory.
 

Additional Inherited Members

- Protected Member Functions inherited from NetSocketPP::NetSocket
void * get_in_addr (sockaddr *sa)
 Needed for implementation purposes.
 
- Protected Attributes inherited from NetSocketPP::ClientSocket
char buf [100000]
 A large buffer for data.
 

Detailed Description

A class representing HTTP client socket.

Constructor & Destructor Documentation

HTTPClientSocket::HTTPClientSocket ( std::string  host = NULL,
std::string  service = "http",
std::string  docRequest = "/" 
)

A constructor with parameters.

Parameters
hostHostname or IP of socket destination, defaults to NULL.
serviceService port or identifier, defaults to HTTP.
docRequestA document to request from the server, defaults to root/index (/).

Member Function Documentation

HTTPReply HTTPClientSocket::getReply ( )

A function returning a HTTPReply.

Returns
HTTPReply object containing received data.
std::string HTTPClientSocket::getRequest ( )

A function returning the request used in the socket.

Returns
The HTTP request used to obtain data.

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