moved uv to io

This commit is contained in:
Dominik Tomičević 2015-09-20 14:30:26 +02:00
parent ab33fce01b
commit 55aa4f7fa1
15 changed files with 13 additions and 12 deletions

View File

@ -1,7 +1,7 @@
CXX=clang++
CFLAGS=-std=c++11 -Wall
LDFLAGS=-luv -lhttp_parser
INC=-I./
INC=-I../
SOURCES=$(wildcard *.cpp)
EXECUTABLE=test.out
# OBJECTS=$(SOURCES:.cpp=.o)
@ -9,7 +9,7 @@ EXECUTABLE=test.out
all: $(EXECUTABLE)
$(EXECUTABLE): $(SOURCES)
$(CXX) $(LDFLAGS) $(SOURCES) -o $(EXECUTABLE) $(CFLAGS)
$(CXX) $(LDFLAGS) $(SOURCES) -o $(EXECUTABLE) $(CFLAGS) $(INC)
# .cpp.o:
# $(CXX) $(CFLAGS) $< -o $@ $(LDFLAGS) $(INC)

View File

@ -1,7 +1,7 @@
#ifndef MEMGRAPH_SERVER_HTTP_CONNECTION_HPP
#define MEMGRAPH_SERVER_HTTP_CONNECTION_HPP
#include "uv/uv.hpp"
#include "io/uv/uv.hpp"
#include "httpparser.hpp"
#include "request.hpp"

View File

@ -4,7 +4,7 @@
#include <iostream>
#include <uv.h>
#include "uv/uv.hpp"
#include "io/uv/uv.hpp"
#include "httpparsersettings.hpp"
#include "httpconnection.hpp"
#include "request.hpp"

View File

@ -3,7 +3,7 @@
#include <map>
#include "uv/uv.hpp"
#include "io/uv/uv.hpp"
#include "status_codes.hpp"
namespace http

View File

@ -1,7 +1,7 @@
#ifndef MEMGRAPH_SPEEDY_HPP
#define MEMGRAPH_SPEEDY_HPP
#include "http/uv/uv.hpp"
#include "io/uv/uv.hpp"
#include "http/http.hpp"
namespace speedy
@ -10,11 +10,10 @@ namespace speedy
class Speedy
{
private:
uv::UvLoop loop;
http::HttpServer server;
http::Ipv4 ip;
public:
Speedy(const http::Ipv4& ip);
Speedy(uv::UvLoop& loop, const http::Ipv4& ip);
void get(const std::string path, http::request_cb_t callback);
void listen();
~Speedy();

View File

@ -6,7 +6,7 @@
namespace speedy
{
Speedy::Speedy(const http::Ipv4& ip) : server(loop), ip(ip)
Speedy::Speedy(uv::UvLoop& loop, const http::Ipv4& ip) : server(loop), ip(ip)
{
}
@ -21,8 +21,6 @@ void Speedy::listen()
});
std::cout << "Server is UP" << std::endl;
loop.run(uv::UvLoop::Mode::Default);
}
Speedy::~Speedy()

View File

@ -4,9 +4,13 @@
int main(void)
{
uv::UvLoop loop;
http::Ipv4 ip("0.0.0.0", 3400);
speedy::Speedy app(ip);
speedy::Speedy app(loop, ip);
app.listen();
loop.run(uv::UvLoop::Mode::Default);
return 0;
}