Skip to content

Instantly share code, notes, and snippets.

View padenot's full-sized avatar
🦊
counting bytes

Paul Adenot padenot

🦊
counting bytes
View GitHub Profile
#include <iostream>
#include <vector>
#include <assert.h>
int main()
{
std::vector<int> vec_int;
vec_int.push_back(1);
#include <stdio.h>
#include <stdlib.h>
#include <netdb.h>
#include <netinet/in.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#define BUFFER_SIZE 128
HttpRequest::HttpRequest (const std::string& url)
:attributeCount_(0),
url_(url),
hostname_(url.substr(0, url.find_first_of('/'))),
path_(url.substr(url.find_first_of('/'))),
resolver_(io_service_),
socket_(io_service_)
{
//check if a port is in the hostname.
size_t index = hostname_.find_first_of(':');