mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +02:00
Remove Handle argument from I/O constructors (#61)
This commit removes the `Handle` argument from the following constructors * `TcpListener::bind` * `TcpStream::connect` * `UdpSocket::bind` The `Handle` argument remains on the various `*_std` constructors as they're more low-level, but this otherwise is intended to set forth a precedent of by default not taking `Handle` arguments and instead relying on the global `Handle::default` return value when necesary.
This commit is contained in:
committed by
Carl Lerche
parent
849771ecfa
commit
4ef772b2db
+2
-2
@@ -18,9 +18,9 @@ pub use self::frame::{UdpFramed, UdpCodec};
|
||||
impl UdpSocket {
|
||||
/// This function will create a new UDP socket and attempt to bind it to
|
||||
/// the `addr` provided.
|
||||
pub fn bind(addr: &SocketAddr, handle: &Handle) -> io::Result<UdpSocket> {
|
||||
pub fn bind(addr: &SocketAddr) -> io::Result<UdpSocket> {
|
||||
let udp = try!(mio::net::UdpSocket::bind(addr));
|
||||
UdpSocket::new(udp, handle)
|
||||
UdpSocket::new(udp, &Handle::default())
|
||||
}
|
||||
|
||||
fn new(socket: mio::net::UdpSocket, handle: &Handle) -> io::Result<UdpSocket> {
|
||||
|
||||
Reference in New Issue
Block a user