rust/src
Jeff Olson 6c6a47bf22 std: splitting out tcp server API + tests
- we now have two interfaces for the TCP/IP server/listener workflow,
based on different user approaches surrounding how to deal with the
flow of accept a new tcp connection:

1. the "original" API closely mimics the low-level libuv API, in that we
have an on_connect_cb that the user provides *that is ran on the libuv
thread*. In this callback, the user can accept() a connection, turning it
into a tcp_socket.. of course, before accepting, they have the option
of passing it to a new task, provided they *make the cb block until
the accept is done* .. this is because, in libuv, you have to do the
uv_accept call in the span of that on_connect_cb callback that gets fired
when a new connection comes in. thems the breaks..

I wanted to just get rid of this API, because the general proposition of
users always running code on the libuv thread sounds like an invitation
for many future headaches. the API restriction to have to choose to
immediately accept a connection (and allow the user to block libuv as
needed) isn't too bad for power users who could conceive of circumstances
where they would drop an incoming TCP connection and know what they're
doing, in general.

but as a general API, I thought this was a bit cumbersome, so I ended up
devising..

2. an API that is initiated with a call to `net::tcp::new_listener()` ..
has a similar signature to `net::tcp::listen()`, except that is just
returns an object that sort of behaves like a `comm::port`. Users can
block on the `tcp_conn_port` to receive new connections, either in the
current task or in a new task, depending on which API route they take
(`net::tcp::conn_recv` or `net::tcp::conn_recv_spawn` respectively).. there
is also a `net::tcp::conn_peek` function that will do a peek on the
underlying port to see if there are pending connections.

The main difference, with this API, is that the low-level libuv glue is
going to *accept every connection attempt*, along with the overhead that
that brings. But, this is a much more hassle-free API for 95% of use
cases and will probably be the one that most users will want to reach for.
2012-05-22 22:29:17 -07:00
..
cargo Remove some dead code. 2012-05-19 10:08:43 -07:00
compiletest Fix compiletest::header::iter_header to work with new-style for loops 2012-05-03 17:45:06 -07:00
etc vim: Fix syntax of number literals 2012-05-05 11:43:07 +09:00
fuzzer remove mutable cycle from ast_fold 2012-05-21 20:07:14 -07:00
libcore core: add result::unwrap() .. patch from @nmatsakis 2012-05-22 22:29:16 -07:00
librustsyntax Merge branch 'master' of git://github.com/mozilla/rust 2012-05-22 18:23:32 -07:00
libstd std: splitting out tcp server API + tests 2012-05-22 22:29:17 -07:00
libuv@1170ffba3a rustc: Don't generate landing pad cleanups for boxy things 2012-03-29 16:43:18 -07:00
llvm@3a57b672f8 Update llvm and integrate clang and compiler-rt. 2012-04-30 17:48:38 -07:00
rt std: splitting out tcp server API + tests 2012-05-22 22:29:17 -07:00
rustc Convert more resource tests to use classes with dtors 2012-05-22 22:12:18 -04:00
rustdoc Send is no longer a subkind of copy. This allows for sendable, but non-copyable resources. Closes #2420. 2012-05-22 14:10:32 -07:00
rustllvm Update llvm and integrate clang and compiler-rt. 2012-04-30 17:48:38 -07:00
test Merge pull request #2430 from mmeyerho/master 2012-05-22 20:39:53 -07:00
README.txt Update src/README.txt. Closes #2147 2012-04-09 14:03:48 -07:00
snapshots.txt Register snapshots 2012-05-21 18:08:39 -07:00

This is preliminary version of the Rust compiler, libraries and tools

Source layout:

rustc/             The self-hosted compiler

libcore/           The core library (imported and linked by default)
libstd/            The standard library (slightly more peripheral code)
librustsyntax/     The Rust parser and pretty-printer

rt/                The runtime system
rt/rust_*.cpp      - The majority of the runtime services
rt/isaac           - The PRNG used for pseudo-random choices in the runtime
rt/bigint          - The bigint library used for the 'big' type
rt/uthash          - Small hashtable-and-list library for C, used in runtime
rt/sync            - Concurrency utils
rt/util            - Small utility classes for the runtime.
rt/vg              - Valgrind headers
rt/msvc            - MSVC support

test/              Testsuite
test/compile-fail  - Tests that should fail to compile
test/run-fail      - Tests that should compile, run and fail
test/run-pass      - Tests that should compile, run and succeed
test/bench         - Benchmarks and miscellanea
test/pretty        - Pretty-printer tests
test/auxiliary     - Dependencies of tests

compiletest/       The test runner

cargo/             The package manager

rustdoc/           The Rust API documentation tool

llvm/              The LLVM submodule

libuv/             The libuv submodule

rustllvm/          LLVM support code

fuzzer/            A collection of fuzz testers

etc/               Scripts, editor support, misc