summary refs log tree commit diff
path: root/src/libstd/rt/io/net
AgeCommit message (Collapse)AuthorLines
2013-09-16std::rt::io::net::tcp: Fix one tcp test on Win32klutzy-2/+7
Fixes `connect_error` part of #8811.
2013-09-12std: Rename {Option,Result}::chain{,_err}* to {and_then,or_else}Erick Tryzelaar-1/+1
2013-09-11auto merge of #9114 : sfackler/rust/flush-fix, r=brsonbors-1/+1
2013-09-10Don't fail in TcpStream.flushSteven Fackler-1/+1
2013-09-06Make I/O tests use run_in_mt_newsched_task to get more multi-threaded test ↵Eric Reed-26/+125
coverage
2013-09-06Upgrade libuv to the current master (again)Alex Crichton-1/+1
This is a reopening of the libuv-upgrade part of #8645. Hopefully this won't cause random segfaults all over the place. The windows regression in testing should also be fixed (it shouldn't build the whole compiler twice). A notable difference from before is that gyp is now a git submodule instead of always git-cloned at make time. This allows bundling for releases more easily. Closes #8850
2013-09-05std::rt: Add get_host_addresses functionBrian Anderson-2/+43
This is a very simplistic method for host name resolution. It converts a host name to a vector of IP addresses. Should be enough to get started.
2013-09-05std::rt: Add libuv bindings for getaddrinfoBrian Anderson-0/+21
2013-09-04stop treating char as an integer typeDaniel Micay-6/+7
Closes #7609
2013-06-23Split out starting a listener from accepting incoming connections.Eric Reed-51/+63
The Listener trait takes two type parameters, the type of connection and the type of Acceptor, and specifies only one method, listen, which consumes the listener and produces an Acceptor. The Acceptor trait takes one type parameter, the type of connection, and defines two methods. The accept() method waits for an incoming connection attempt and returns the result. The incoming() method creates an iterator over incoming connections and is a default method. Example: let listener = TcpListener.bind(addr); // Bind to a socket let acceptor = listener.listen(); // Start the listener for stream in acceptor.incoming() { // Process incoming connections forever (or until you break out of the loop) }
2013-08-29auto merge of #8819 : vadimcn/rust/unit-tests, r=brsonbors-0/+5
Some of the tests are failing. I've only managed to fix 'memory_map_file', the rest are up for grabs... Fixes #5261.
2013-08-29Revert "auto merge of #8645 : alexcrichton/rust/issue-6436-run-non-blocking, ↵Brian Anderson-4/+4
r=brson" This reverts commit b8d1fa399402c71331aefd634d710004e00b73a6, reversing changes made to f22b4b169854c8a4ba86c16ee43327d6bcf94562. Conflicts: mk/rt.mk src/libuv
2013-08-28Turned off libstd unit tests that currently fail on Windows.Vadim Chugunov-0/+5
2013-08-27Implement process bindings to libuvAlex Crichton-3/+3
Closes #6436
2013-08-27Upgrade libuv to the current master + our patchesAlex Crichton-1/+1
There were two main differences with the old libuv and the master version: 1. The uv_last_error function is now gone. The error code returned by each function is the "last error" so now a UvError is just a wrapper around a c_int. 2. The repo no longer includes a makefile, and the build system has change. According to the build directions on joyent/libuv, this now downloads a `gyp` program into the `libuv/build` directory and builds using that. This shouldn't add any dependences on autotools or anything like that. Closes #8407 Closes #6567 Closes #6315
2013-08-27librustc: Ensure that type parameters are in the right positions in paths.Patrick Walton-20/+40
This removes the stacking of type parameters that occurs when invoking trait methods, and fixes all places in the standard library that were relying on it. It is somewhat awkward in places; I think we'll probably want something like the `Foo::<for T>::new()` syntax.
2013-08-21auto merge of #8600 : sfackler/rust/http, r=brsonbors-29/+0
It's an empty stub and as one of the comments notes, doesn't belong in libstd.
2013-08-19Do not execute the callback before cleaning up resources.Eric Reed-6/+2
2013-08-19Derive Clone for IpAddr and SocketAddrEric Reed-2/+2
2013-08-18Delete std::rt::io::net::httpSteven Fackler-29/+0
It's an empty stub and as one of the comments notes, doesn't belong in libstd.
2013-08-09Fix Ipv6Addr to_str for ::1:x.x.x.x addressesStepan Koltsov-1/+8
Reported by luqmana@
2013-08-06Implement FromStr for IpAddr and SocketAddrStepan Koltsov-0/+365
Better than that in rt::uv::net, because it: * handles invalid input explicitly, without fail!() * parses socket address, not just IP * handles various ipv4-in-ipv6 addresses, like 2001:db8:122:344::192.0.2.33 (see http://tools.ietf.org/html/rfc6052 for example) * rejects output like `127.0000000.0.1` * does not allocate heap memory * have unit tests
2013-08-04auto merge of #8243 : stepancheg/rust/ipv, r=brsonbors-37/+53
multicast functions now take IpAddr (without port), because they dont't need port. Uv* types renamed: * UvIpAddr -> UvSocketAddr * UvIpv4 -> UvIpv4SocketAddr * UvIpv6 -> UvIpv6SocketAddr "Socket address" is a common name for (ip-address, port) pair (e.g. in sockaddr_in struct). P. S. Are there any backward compatibility concerns? What is std::rt module, is it a part of public API?
2013-08-03remove obsolete `foreach` keywordDaniel Micay-4/+4
this has been replaced by `for`
2013-08-03Rename IpAddr -> SocketAddr, extract IpAddr from SocketAddrStepan Koltsov-37/+53
multicast functions now take IpAddr (without port), because they dont't need port. Uv* types renamed: * UvIpAddr -> UvSocketAddr * UvIpv4 -> UvIpv4SocketAddr * UvIpv6 -> UvIpv6SocketAddr "Socket address" is a common name for (ip-address, port) pair (e.g. in sockaddr_in struct).
2013-08-02replace `range` with an external iteratorDaniel Micay-5/+5
2013-08-01modified local to include an implementation for try_unsafe_borrow::<Task> so ↵toddaaro-2/+2
that the log methods will work
2013-08-01minor tweaks - unboxed the coroutine so that it is no longer a ~ pointer ↵toddaaro-4/+4
inside the task struct, and also added an assert to verify that send is never called inside scheduler context as it is undefined (BROKEN) if that happens
2013-08-01A major refactoring that changes the way the runtime uses TLS. In thetoddaaro-38/+38
old design the TLS held the scheduler struct, and the scheduler struct held the active task. This posed all sorts of weird problems due to how we wanted to use the contents of TLS. The cleaner approach is to leave the active task in TLS and have the task hold the scheduler. To make this work out the scheduler has to run inside a regular task, and then once that is the case the context switching code is massively simplified, as instead of three possible paths there is only one. The logical flow is also easier to follow, as the scheduler struct acts somewhat like a "token" indicating what is active. These changes also necessitated changing a large number of runtime tests, and rewriting most of the runtime testing helpers. Polish level is "low", as I will very soon start on more scheduler changes that will require wiping the polish off. That being said there should be sufficient comments around anything complex to make this entirely respectable as a standalone commit.
2013-08-01std: Change `Times` trait to use `do` instead of `for`blake2-ppc-4/+4
Change the former repetition:: for 5.times { } to:: do 5.times { } .times() cannot be broken with `break` or `return` anymore; for those cases, use a numerical range loop instead.
2013-08-01make `in` and `foreach` get treated as keywordsDaniel Micay-5/+5
2013-07-26libstd: Tests for {peer, socket}_name.Luqman Aden-0/+86
2013-07-25libstd: Add ToStr impl for IpAddr.Luqman Aden-0/+42
2013-07-25libstd: Get rid of duplication in {peer, socket}_name and remove extra *.Luqman Aden-3/+3
2013-07-25libstd: Implement {peer, socket}_name for new rt tcp & udp.Luqman Aden-3/+48
2013-07-19Changed methods on UDP sockets and TCP/UDP watchers to &mut self to reflect ↵Eric Reed-8/+9
that libuv may change the underlying handle.
2013-07-02IPv6 support for UDP and TCP.Eric Reed-9/+271
2013-06-26converted TCP interface to newtype structsEric Reed-24/+9
2013-06-26removed unecessary methodEric Reed-3/+1
2013-06-25Converted UdpSocket into a newtype struct and (dis)connecting uses move ↵Eric Reed-27/+12
semantics rather than ~.
2013-06-25IPv6 structEric Reed-2/+4
2013-06-25satisfy the formatting checkEric Reed-2/+2
2013-06-25UDP networking with testsEric Reed-4/+99
2013-06-19derived instances of Eq and TotalEq for IpAddr rather than implement them ↵Eric Reed-21/+1
manually.
2013-06-19socket based UDP ioEric Reed-24/+77
2013-06-19Wrote the Eq instance of IpAddr in a slightly different way.Eric Reed-3/+3
2013-06-17Merge remote-tracking branch 'upstream/io' into ioEric Reed-2/+2
Conflicts: src/libstd/rt/uvio.rs
2013-06-17stated to implement UdpStreamEric Reed-4/+13
2013-06-17added Eq and TotalEq instances for IpAddrEric Reed-0/+21
2013-06-04std::cell: Modernize constructorsPhilipp Brüschweiler-2/+2
Part of #3853