Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:Martiusweb/bim
- Loading branch information
Showing
8 changed files
with
59 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.swp | ||
code/server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bin/* | ||
*.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* This file is part of Bim, the web server which goes fast. | ||
* © Martin Richard & Paul Adenot | ||
* | ||
* Bim is free software : you can redistribute it and/or modify it under the | ||
* terms of the license. | ||
*/ | ||
|
||
|
||
#include "dispatcher.hpp" | ||
|
||
#include <unistd.h> | ||
#include <sys/types.h> | ||
#include <sys/epoll.h> | ||
|
||
namespace bim | ||
{ | ||
dispatcher::dispatcher(int max_events): | ||
_epoll(0), _max_events(max_events) | ||
{ | ||
} | ||
|
||
dispatcher::~dispatcher() | ||
{ | ||
if(_epoll != 0) { | ||
close(); | ||
} | ||
} | ||
|
||
bool dispatcher::open() | ||
{ | ||
if((_epoll = epoll_create(_max_events)) == -1) { | ||
_epoll = 0; | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
void dispatcher::close() | ||
{ | ||
::close(_epoll); | ||
} | ||
|
||
void dispatch() | ||
{ | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,3 +59,4 @@ namespace bim | |
close(); | ||
} | ||
} | ||
|