about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2012-05-22std:: adding tcp::read fn as simple, blocking read operation, akin to writeJeff Olson-90/+219
also: read_future ala write_future .. woooooohooooooooo
2012-05-22std: adding tcp::write_future for non-block tcp writes, docs cleanupJeff Olson-44/+52
2012-05-22std: several minor cleanups wrt codereview.. see extended commentsJeff Olson-31/+26
* there are a few places where I was experimenting w/ using `alt` in places where `if`/`else` would've sufficed. don't drink the koolaid! * I had an unneeded `else` structure (the `if` branch that preceeded concluded with a `fail` statement.. I added the `fail` later in the dev cycle for this branch, so I forgot to remove the `else` after doing so) * consistent wrt `prop_name: value` vs. `prop_name : value` in record decl and initialization * change an `alt` exp on an `ip_addr` to actually be exhaustive, instead of using a catch-all clause
2012-05-22std: add try_parse_addr and change an alt w/ ip_addr::ipv6 to avoid warningJeff Olson-6/+30
2012-05-22std: more docs and some methods for types in net::tcpJeff Olson-4/+66
2012-05-22std: ignoring timer test that seems to be race-failing b/c valgrindJeff Olson-0/+1
.. this test fails frequently, locally, when ran with the batch of other global_loop tests running due to how valgrind deals with multithreading in the test app. not sure what to do, here.
2012-05-22std: splitting out tcp server API + testsJeff Olson-100/+226
- 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-22std: splitting out tcp server API WIPJeff Olson-79/+293
2012-05-22std: reworking how some net and libuv modules are exported in the rcJeff Olson-1/+2
.. turns out that, without the export, the modules aren't accessible outside of the crate, itself. I thought that, by importing some module into another (nesting it) and exporting from that nested module (which is, itself, exported from std.rc) that my mod would be in the build artifact. This doesn't appear to be the case. learning is fun!
2012-05-22std: tightening up net::tcp, server/client test done, still has races..Jeff Olson-222/+325
.. going to rework the listen() API to be non-blocking.
2012-05-22std: change sig of uv::ll::accept, again.Jeff Olson-1/+1
2012-05-22std: first-pass at a tcp server API, with a basic (non-robust) testJeff Olson-20/+396
also whitespace cleanup .. for now, the test just spins up the server and listens for messages, echoing them back to an output port. there's a "kill" msg that it will listen for. need to point the tcp client and server test impls at each other for a loopback server/client test, like how its done in uv::ll once ipv6 parse/format lands, i can add another test using the entirely same codebase, but substituting an ip_addr ipv6 varient for the ipv4 varient used in the existing code still need some other plumbing to get the client/server tests to work together.
2012-05-22std: FIXME stub net::ip::ip_addr::ipv6 variant...needs parse/format implJeff Olson-0/+4
still need implementation for parsing/output formatting and (perhaps?) representation (for now, i just followef the ipv4 variant's lead and am representing it as a tuple of 8x u16). parsing an ipv6 addr is way more complex than parsing an ipv4 addr, so i'm putting off an implementation here, for now. candidate solutions: - could use getaddrinfo() (exists on both POSIX and windows), but with incompatible fn signatures. - libuv has a way to parse an ipv6 string into a sockaddr_in6, but it also requires a port, so it's probably not aprop for ip_addr
2012-05-22std: makeing uv::ll::listen/accept use generic params for ptr argsJeff Olson-4/+5
more flexibility..
2012-05-22std: change tcp_*_result to use result::result.. flatter!Jeff Olson-120/+168
2012-05-22std: no longer return uv::ll::err_data records from net::tcpJeff Olson-12/+27
they're changed into a net::tcp::tcp_err_data record, for now. once the scope of possible tcp errors, from libuv, is established ill create an err type for each one and return those where they might occur
2012-05-22std: impl for high-level tcp client/request workflowJeff Olson-25/+150
2012-05-22std: impl of net::tcp::write and make net::tcp::tcp_socket a resourceJeff Olson-18/+126
2012-05-22std: tweak uv::ll::write signature and make it generic/more flexibleJeff Olson-4/+6
2012-05-22std: impl for net::tcp::connectJeff Olson-11/+204
2012-05-22std: export net::ip::format_addrJeff Olson-0/+1
2012-05-22std: misc cleanup for uv::llJeff Olson-6/+20
* tweaked the layout of sockaddr_in6 struct in anticipation of future use * changed several uv:ll fn signatures to use generics and be more flexible with ptr types they get passed * add uv_err_data and a help fn to return it.. packages up err_name and err_msg info from uv_get_last_error() stuff..
2012-05-22std: pushing existing code in net.rs -> net_ip.rs and re-import/exportingJeff Olson-47/+80
2012-05-22initial stab at API for std::net::tcpJeff Olson-0/+60
2012-05-22Removing par.rs, since it's not usable now anyway.Eric Holk-105/+0
2012-05-22Adding a module with parallel vector operations.Eric Holk-0/+105
This should go in libstd, but currently resolve bugs make this not work.
2012-05-22Send is no longer a subkind of copy. This allows for sendable, but ↵Eric Holk-2/+4
non-copyable resources. Closes #2420.
2012-05-22impl-ify mapNiko Matsakis-146/+134
2012-05-21Merge pull request #2413 from erickt/masterBrian Anderson-1/+18
a couple misc changes
2012-05-21std: Make timer tests more reliable under valgrindBrian Anderson-25/+43
2012-05-21change list so that it must be used in a purely boxed fashionNiko Matsakis-10/+12
The old way was inconsistent---the head was unboxed but the tail was boxed. This resulted in numerous needless copies and also made the borrow check unhappy, because the head tended to be stored in mutable memory.
2012-05-21make list based on boxesNiko Matsakis-52/+39
2012-05-19std: Fix a typoErick Tryzelaar-1/+1
2012-05-19expose tzsetErick Tryzelaar-0/+17
2012-05-18port smallintmap over to dvecNiko Matsakis-28/+18
also: add a non-operator-overloaded method for [] to work around #2378
2012-05-18avoid modifying the variable we are alting overNiko Matsakis-11/+8
2012-05-18introduce a few copies here and thereNiko Matsakis-1/+1
2012-05-18purge ufindNiko Matsakis-55/+1
2012-05-18Using const vector slices for more vec functions.Eric Holk-1/+2
2012-05-18std: Don't copy hash key until we mustBrian Anderson-2/+2
2012-05-17Added a method to convert sets to vectors.Eric Holk-0/+13
2012-05-15Remove `be` keyword.Lindsey Kuper-1/+1
Closes #2227.
2012-05-03Comment only: Annotate FIXMEs in std::timeTim Chevalier-1/+2
2012-05-03Write unicode::icu::UCHAR_INVALID_CODE as -1, removing a FIXMETim Chevalier-3/+1
2012-05-03Comments only: annotate more FIXMEs in libstdTim Chevalier-3/+3
2012-05-03Annotate more FIXMES in libstd (comments only)Tim Chevalier-7/+7
2012-05-03Annotate FIXMEs in std::bitv, and remove a FIXMETim Chevalier-8/+3
Changed a while loop into a for loop in std::bitv::equal. Yay!
2012-05-02std: Do less work in the timer stress testsBrian Anderson-4/+4
2012-05-01Merge pull request #2322 from bkircher/fix-getopts-docsBrian Anderson-9/+27
Fix getopts docs
2012-05-01std: Fix example in getopts module docsBenjamin Kircher-7/+25
Issue #1833.