Updated readme, updated epoll.
This commit is contained in:
parent
fd42b11c8b
commit
ae1194e159
|
@ -26,7 +26,7 @@ class MyHandler : HttpRequestHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
HttpTransport tp = new Http1Transport(new MyHandler(), 8080);
|
HttpTransport tp = new TaskPoolHttp1Transport(new MyHandler(), 8080);
|
||||||
tp.start();
|
tp.start();
|
||||||
}
|
}
|
||||||
```
|
```
|
|
@ -13,17 +13,18 @@ extern(C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
import handy_http_transport.interfaces;
|
import handy_http_transport.interfaces;
|
||||||
|
import handy_http_transport.http1;
|
||||||
|
import handy_http_primitives;
|
||||||
import slf4d;
|
import slf4d;
|
||||||
|
|
||||||
class Http1EpollTransport : HttpTransport {
|
class Http1EpollTransport : Http1Transport {
|
||||||
private immutable ushort port;
|
|
||||||
|
|
||||||
this(ushort port) {
|
this(HttpRequestHandler requestHandler, ushort port) {
|
||||||
this.port = port;
|
super(requestHandler, port);
|
||||||
}
|
}
|
||||||
|
|
||||||
void start() {
|
override void start() {
|
||||||
|
super.start();
|
||||||
// Create the server socket.
|
// Create the server socket.
|
||||||
enum SOCK_NONBLOCK = 0x4000;
|
enum SOCK_NONBLOCK = 0x4000;
|
||||||
int listenFd = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0);
|
int listenFd = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0);
|
||||||
|
@ -118,8 +119,4 @@ class Http1EpollTransport : HttpTransport {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void stop() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue