summary refs log tree commit diff
path: root/src/libstd/rt/rtio.rs
AgeCommit message (Collapse)AuthorLines
2013-08-22std: slight refactor on UvFilestream seek behavior, pre-seek-refactorJeff Olson-1/+2
2013-08-22std: rework file io.. support [p]read,[p]write, impl seek/tell + more testsJeff Olson-5/+10
2013-08-22std: rt::io::file::FileStream fleshed out.. needs more work.. see extendedJeff Olson-2/+3
- change all uses of Path in fn args to &P - FileStream.read assumptions were wrong (libuv file io is non-positional) - the above will mean that we "own" Seek impl info .. should probably push it in UvFileDescriptor.. - needs more tests
2013-08-22std: CRUD file io bindings in uvio, fs_open()/unlink() in IoFactory + testJeff Olson-0/+23
2013-08-20auto merge of #8631 : anasazi/rust/homing-io, r=brsonbors-1/+1
libuv handles are tied to the event loop that created them. In order to perform IO, the handle must be on the thread with its home event loop. Thus, when as task wants to do IO it must first go to the IO handle's home event loop and pin itself to the corresponding scheduler while the IO action is in flight. Once the IO action completes, the task is unpinned and either returns to its home scheduler if it is a pinned task, or otherwise stays on the current scheduler. Making new blocking IO implementations (i.e. files) thread safe is rather simple. Add a home field to the IO handle's struct in uvio and implement the HomingIO trait. Wrap every IO call in the HomingIO.home_for_io method, which will take care of the scheduling. I'm not sure if this remains thread safe in the presence of asynchronous IO at the libuv level. If we decide to do that, then this set up should be revisited.
2013-08-19Make IO thread-safe.Eric Reed-2/+2
Each IO handle has a home event loop, which created it. When a task wants to use an IO handle, it must first make sure it is on that home event loop. It uses the scheduler handle in the IO handle to send itself there before starting the IO action. Once the IO action completes, the task restores its previous home state. If it is an AnySched task, then it will be executed on the new scheduler. If it has a normal home, then it will return there before executing any more code after the IO action.
2013-08-19Homed UDP socketsEric Reed-1/+1
2013-08-16Moved the logic for a pausible idle callback into a new type - ↵toddaaro-5/+8
PausibleIdleCallback and placed the appropriate signatures in rtio and implementation into uvio.
2013-08-03Rename IpAddr -> SocketAddr, extract IpAddr from SocketAddrStepan Koltsov-8/+8
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-07-25libstd: Implement some missing udp methods.Luqman Aden-8/+8
2013-07-25libstd: Implement some missing tcp methods.Luqman Aden-6/+6
2013-07-25libstd: Implement {peer, socket}_name for new rt tcp & udp.Luqman Aden-2/+2
2013-07-22std: add RtioTimer and UvTimer impl atop rt::uvJeff Olson-0/+6
2013-07-19Changed methods on UDP sockets and TCP/UDP watchers to &mut self to reflect ↵Eric Reed-20/+20
that libuv may change the underlying handle.
2013-07-02converted TODOs into XXXsEric Reed-1/+0
2013-07-02IPv6 support for UDP and TCP.Eric Reed-3/+27
2013-06-19socket based UDP ioEric Reed-7/+7
2013-06-17Added a RtioUdpStream traitEric Reed-0/+7
2013-05-29Merge remote-tracking branch 'brson/io' into incomingBrian Anderson-0/+11
Conflicts: src/libstd/rt/sched.rs
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-0/+45
This only changes the directory names; it does not change the "real" metadata names.