Commit Graph

22 Commits

Author SHA1 Message Date
Tomasz Grabiec
86246a4c0e tests: add test for bug in error propagation by future::then() 2014-10-01 13:45:28 +02:00
Tomasz Grabiec
6f1d1d6627 tests: add tests for future::rescue() 2014-10-01 13:45:28 +02:00
Tomasz Grabiec
0269fd6f15 tests: add tests for future::finally() 2014-10-01 13:45:28 +02:00
Tomasz Grabiec
48a86b7073 core: make timer callbacks synchronous with state changes
It allows for simpler client code because the client can assume that
when cancel() returns the callback will not run and thus there's no
need to handle the race between timer teardown and execution of the
callback.
2014-10-01 13:21:10 +02:00
Tomasz Grabiec
9a0ab2f1a4 tests: introduce some basic utilities used by tests 2014-10-01 13:21:09 +02:00
Asias He
c5d623265d net: Support ping 2014-09-25 17:49:38 +03:00
Pekka Enberg
0dfdd3e548 Use braces around subobject initialization
There seems to be some issue with std::array initialization brace elision with Clang:

  http://stackoverflow.com/questions/16985687/brace-elision-in-stdarray-initialization

Sprinkle enough braces to make Clang happy.
2014-09-22 16:37:00 +03:00
Avi Kivity
4ca2d67406 tcp_test: terminate on connection closed 2014-09-22 14:22:17 +03:00
Avi Kivity
313768654a net: remove queuing from l2->l3 rx path
Use a subscription instead.  Queueing should be implemented at the highest
possible level (e.g. tcp), to avoid double-queueing.
2014-09-22 11:28:35 +03:00
Avi Kivity
4738f3f05c net: switch device rx to stream<packet>
Still have that internal rx queue.
2014-09-22 11:27:47 +03:00
Avi Kivity
37c90fe54e net: make packet data members private
This will assist in future refactoring.
2014-09-16 11:24:13 +03:00
Tomasz Grabiec
52ab797536 rename engine::start() to engine::when_started()
The imperative form suggests that in addition to returning a future it
performs some action and thus is needed regardless of whether we want
to add a callback or not. But in fact it does not do anything, just
gives away a future.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
2014-09-16 09:59:13 +03:00
Avi Kivity
3def4bc7d7 tcp: queue connections being accepted
With the current listen() -> future<connection> interface, if a new connection
is established before the connection handler is able to re-register for the
port, we have to drop the connection.

Fix by adding a queue for accepted connections, and switching to the more
standard listen() -> accept() -> future<connection> model.
2014-09-14 16:05:48 +03:00
Asias He
647a0cacd3 net: Add ipv4_address(string) constructor
Set ipv4 address using dotted decimal form.

Signed-off-by: Asias He <asias@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
2014-09-13 07:20:31 +03:00
Avi Kivity
b6d85fc6a6 s/the_reactor/engine/g
Things named "engine" are 20% faster.
2014-09-10 15:46:33 +03:00
Avi Kivity
6565909722 s/bsd/posix/
"bsd" in this context refers to BSD sockets, but it will be a lot less
confusing to refer to it as a POSIX API.
2014-09-09 09:18:39 +03:00
Avi Kivity
147046adea Fix copyrights 2014-09-04 18:39:25 +03:00
Avi Kivity
6c1aabd7e1 core: abstrace reactor::listen()
Instead of returning the Unix-tied pollable_fd, return an abstract
server_socket class which is then implement atop pollable_fd, but can
be replaced with a native implementation.
2014-09-04 12:11:17 +03:00
Avi Kivity
f8132a8180 net: tcp: change receive() interface
Instead of returning a future<packet>, return a future<> (signifying data
is available) and provide a read() method.

This is useful in case the user wants to consume more or less than exactly
one packet.
2014-09-03 11:57:44 +03:00
Avi Kivity
32a1001ddf tests: add tcp test
Simple echo server on the now famous port 10000.
2014-09-02 20:40:29 +03:00
Avi Kivity
2aa3d0a755 tests: add timer test 2014-09-01 13:01:06 +03:00
Avi Kivity
c77f77ee3f build: organize files into a directory structure 2014-08-31 21:29:13 +03:00