Home
last modified time | relevance | path

Searched refs:SocketAddr (Results 1 – 25 of 60) sorted by relevance

123

/external/rust/crates/tokio/src/net/
Daddr.rs4 use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6};
51 impl ToSocketAddrs for SocketAddr {} implementation
53 impl sealed::ToSocketAddrsPriv for SocketAddr { implementation
54 type Iter = std::option::IntoIter<SocketAddr>;
68 type Iter = std::option::IntoIter<SocketAddr>;
72 SocketAddr::V4(*self).to_socket_addrs(sealed::Internal) in to_socket_addrs()
81 type Iter = std::option::IntoIter<SocketAddr>;
85 SocketAddr::V6(*self).to_socket_addrs(sealed::Internal) in to_socket_addrs()
94 type Iter = std::option::IntoIter<SocketAddr>;
98 let iter = Some(SocketAddr::from(*self)).into_iter(); in to_socket_addrs()
[all …]
Dudp.rs7 use std::net::{self, Ipv4Addr, Ipv6Addr, SocketAddr};
164 fn bind_addr(addr: SocketAddr) -> io::Result<UdpSocket> { in bind_addr()
273 pub fn local_addr(&self) -> io::Result<SocketAddr> { in local_addr() argument
852 pub fn try_recv_buf_from<B: BufMut>(&self, buf: &mut B) -> io::Result<(usize, SocketAddr)> {
934 target: SocketAddr, in poll_send_to() argument
988 pub fn try_send_to(&self, buf: &[u8], target: SocketAddr) -> io::Result<usize> { in try_send_to()
994 async fn send_to_addr(&self, buf: &[u8], target: SocketAddr) -> io::Result<usize> { in send_to_addr()
1026 pub async fn recv_from(&self, buf: &mut [u8]) -> io::Result<(usize, SocketAddr)> { in recv_from() argument
1054 ) -> Poll<io::Result<SocketAddr>> { in poll_recv_from() argument
1120 pub fn try_recv_from(&self, buf: &mut [u8]) -> io::Result<(usize, SocketAddr)> { in try_recv_from() argument
[all …]
/external/rust/crates/mio/src/sys/shell/
Duds.rs2 use crate::net::SocketAddr;
19 pub(crate) fn local_addr(_: &net::UnixDatagram) -> io::Result<SocketAddr> { in local_addr() argument
23 pub(crate) fn peer_addr(_: &net::UnixDatagram) -> io::Result<SocketAddr> { in peer_addr() argument
30 ) -> io::Result<(usize, SocketAddr)> { in recv_from() argument
36 use crate::net::{SocketAddr, UnixStream};
45 pub(crate) fn accept(_: &net::UnixListener) -> io::Result<(UnixStream, SocketAddr)> { in accept() argument
49 pub(crate) fn local_addr(_: &net::UnixListener) -> io::Result<SocketAddr> { in local_addr() argument
55 use crate::net::SocketAddr;
68 pub(crate) fn local_addr(_: &net::UnixStream) -> io::Result<SocketAddr> { in local_addr() argument
72 pub(crate) fn peer_addr(_: &net::UnixStream) -> io::Result<SocketAddr> { in peer_addr() argument
Dtcp.rs3 use std::net::{self, SocketAddr};
16 pub(crate) fn bind(_socket: TcpSocket, _addr: SocketAddr) -> io::Result<()> { in bind()
20 pub(crate) fn connect(_: TcpSocket, _addr: SocketAddr) -> io::Result<net::TcpStream> { in connect()
121 pub fn accept(_: &net::TcpListener) -> io::Result<(net::TcpStream, SocketAddr)> { in accept() argument
125 pub(crate) fn get_localaddr(_: TcpSocket) -> io::Result<SocketAddr> { in get_localaddr() argument
Dudp.rs2 use std::net::{self, SocketAddr};
4 pub fn bind(_: SocketAddr) -> io::Result<net::UdpSocket> { in bind()
/external/rust/crates/mio/src/sys/unix/uds/
Dsocketaddr.rs15 pub struct SocketAddr { struct
28 impl SocketAddr { implementation
55 impl SocketAddr { impl
56 pub(crate) fn new<F>(f: F) -> io::Result<SocketAddr>
69 Ok(SocketAddr::from_parts(sockaddr, socklen))
72 … pub(crate) fn from_parts(sockaddr: libc::sockaddr_un, socklen: libc::socklen_t) -> SocketAddr {
73 SocketAddr { sockaddr, socklen }
106 impl fmt::Debug for SocketAddr { implementation
Ddatagram.rs1 use super::{socket_addr, SocketAddr};
28 pub(crate) fn local_addr(socket: &net::UnixDatagram) -> io::Result<SocketAddr> { in local_addr() argument
32 pub(crate) fn peer_addr(socket: &net::UnixDatagram) -> io::Result<SocketAddr> { in peer_addr() argument
39 ) -> io::Result<(usize, SocketAddr)> { in recv_from() argument
41 let socketaddr = SocketAddr::new(|sockaddr, socklen| { in recv_from()
Dmod.rs2 pub use self::socketaddr::SocketAddr;
106 fn local_addr(socket: RawFd) -> io::Result<SocketAddr> {
107 SocketAddr::new(|sockaddr, socklen| syscall!(getsockname(socket, sockaddr, socklen)))
110 fn peer_addr(socket: RawFd) -> io::Result<SocketAddr> {
111 SocketAddr::new(|sockaddr, socklen| syscall!(getpeername(socket, sockaddr, socklen)))
Dlistener.rs2 use crate::net::{SocketAddr, UnixStream};
25 pub(crate) fn accept(listener: &net::UnixListener) -> io::Result<(UnixStream, SocketAddr)> { in accept() argument
94 .map(|stream| (stream, SocketAddr::from_parts(sockaddr, socklen))) in accept()
97 pub(crate) fn local_addr(listener: &net::UnixListener) -> io::Result<SocketAddr> { in local_addr() argument
Dstream.rs1 use super::{socket_addr, SocketAddr};
33 pub(crate) fn local_addr(socket: &net::UnixStream) -> io::Result<SocketAddr> { in local_addr() argument
37 pub(crate) fn peer_addr(socket: &net::UnixStream) -> io::Result<SocketAddr> { in peer_addr() argument
/external/rust/crates/mio/src/sys/unix/
Dnet.rs3 use std::net::{Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6};
5 pub(crate) fn new_ip_socket(addr: SocketAddr, socket_type: libc::c_int) -> io::Result<libc::c_int> { in new_ip_socket() argument
7 SocketAddr::V4(..) => libc::AF_INET, in new_ip_socket()
8 SocketAddr::V6(..) => libc::AF_INET6, in new_ip_socket()
80 pub(crate) fn socket_addr(addr: &SocketAddr) -> (SocketAddrCRepr, libc::socklen_t) { in socket_addr()
82 SocketAddr::V4(ref addr) => { in socket_addr()
109 SocketAddr::V6(ref addr) => { in socket_addr()
146 ) -> io::Result<SocketAddr> { in to_socket_addr() argument
153 Ok(SocketAddr::V4(SocketAddrV4::new(ip, port))) in to_socket_addr()
160 Ok(SocketAddr::V6(SocketAddrV6::new( in to_socket_addr()
/external/rust/crates/mio/src/sys/windows/
Dnet.rs3 use std::net::SocketAddr;
25 pub(crate) fn new_ip_socket(addr: SocketAddr, socket_type: c_int) -> io::Result<SOCKET> { in new_ip_socket() argument
29 SocketAddr::V4(..) => PF_INET, in new_ip_socket()
30 SocketAddr::V6(..) => PF_INET6, in new_ip_socket()
63 pub(crate) fn socket_addr(addr: &SocketAddr) -> (SocketAddrCRepr, c_int) { in socket_addr()
65 SocketAddr::V4(ref addr) => { in socket_addr()
84 SocketAddr::V6(ref addr) => { in socket_addr()
Dtcp.rs4 use std::net::{self, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6};
36 pub(crate) fn bind(socket: TcpSocket, addr: SocketAddr) -> io::Result<()> { in bind()
48 pub(crate) fn connect(socket: TcpSocket, addr: SocketAddr) -> io::Result<net::TcpStream> { in connect()
113 pub(crate) fn get_localaddr(socket: TcpSocket) -> io::Result<SocketAddr> { in get_localaddr() argument
130 Ok(SocketAddr::V4(SocketAddrV4::new(ip, port))) in get_localaddr()
137 Ok(SocketAddr::V6(SocketAddrV6::new(ip, port, addr.sin6_flowinfo, scope_id))) in get_localaddr()
321 pub(crate) fn accept(listener: &net::TcpListener) -> io::Result<(net::TcpStream, SocketAddr)> { in accept() argument
/external/rust/crates/tokio/src/net/unix/
Dlistener.rs2 use crate::net::unix::{SocketAddr, UnixStream};
121 pub fn local_addr(&self) -> io::Result<SocketAddr> { in local_addr() argument
122 self.io.local_addr().map(SocketAddr) in local_addr()
131 pub async fn accept(&self) -> io::Result<(UnixStream, SocketAddr)> { in accept() argument
138 let addr = SocketAddr(addr); in accept()
149 pub fn poll_accept(&self, cx: &mut Context<'_>) -> Poll<io::Result<(UnixStream, SocketAddr)>> { in poll_accept() argument
151 let addr = SocketAddr(addr); in poll_accept()
Dsocketaddr.rs5 pub struct SocketAddr(pub(super) mio::net::SocketAddr); struct
7 impl SocketAddr { implementation
27 impl fmt::Debug for SocketAddr { implementation
/external/rust/crates/tokio/tests/
Dnet_lookup_host.rs5 use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr};
9 let addr: SocketAddr = "127.0.0.1:8000".parse().unwrap(); in lookup_socket_addr()
17 let addr: SocketAddr = "127.0.0.1:8000".parse().unwrap(); in lookup_str_socket_addr()
29 SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 3000) in resolve_dns()
31 SocketAddr::new(IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1)), 3000) in resolve_dns()
/external/rust/crates/tokio/src/net/unix/datagram/
Dsocket.rs2 use crate::net::unix::SocketAddr;
739 pub fn try_recv_buf_from<B: BufMut>(&self, buf: &mut B) -> io::Result<(usize, SocketAddr)> {
756 Ok((n, SocketAddr(addr)))
897 pub async fn recv_from(&self, buf: &mut [u8]) -> io::Result<(usize, SocketAddr)> { in recv_from() argument
904 Ok((n, SocketAddr(addr))) in recv_from()
928 ) -> Poll<io::Result<SocketAddr>> { in poll_recv_from() argument
943 Poll::Ready(Ok(SocketAddr(addr))) in poll_recv_from()
1090 pub fn try_recv_from(&self, buf: &mut [u8]) -> io::Result<(usize, SocketAddr)> { in try_recv_from() argument
1096 Ok((n, SocketAddr(addr))) in try_recv_from()
1139 pub fn local_addr(&self) -> io::Result<SocketAddr> { in local_addr() argument
[all …]
/external/crosvm/sys_util/src/
Dvsock.rs117 pub struct SocketAddr { struct
123 fn to_socket_addr(&self) -> result::Result<SocketAddr, AddrParseError>; in to_socket_addr() argument
126 impl ToSocketAddr for SocketAddr { implementation
127 fn to_socket_addr(&self) -> result::Result<SocketAddr, AddrParseError> { in to_socket_addr() argument
133 fn to_socket_addr(&self) -> result::Result<SocketAddr, AddrParseError> { in to_socket_addr() argument
139 fn to_socket_addr(&self) -> result::Result<SocketAddr, AddrParseError> { in to_socket_addr() argument
141 Ok(SocketAddr { cid, port }) in to_socket_addr()
146 fn to_socket_addr(&self) -> result::Result<SocketAddr, AddrParseError> { in to_socket_addr() argument
151 impl FromStr for SocketAddr { implementation
156 fn from_str(s: &str) -> Result<SocketAddr, AddrParseError> { in from_str() argument
[all …]
/external/libchromeos-rs/src/
Dvsock.rs117 pub struct SocketAddr { struct
123 fn to_socket_addr(&self) -> result::Result<SocketAddr, AddrParseError>; in to_socket_addr() argument
126 impl ToSocketAddr for SocketAddr { implementation
127 fn to_socket_addr(&self) -> result::Result<SocketAddr, AddrParseError> { in to_socket_addr() argument
133 fn to_socket_addr(&self) -> result::Result<SocketAddr, AddrParseError> { in to_socket_addr() argument
139 fn to_socket_addr(&self) -> result::Result<SocketAddr, AddrParseError> { in to_socket_addr() argument
141 Ok(SocketAddr { cid, port }) in to_socket_addr()
146 fn to_socket_addr(&self) -> result::Result<SocketAddr, AddrParseError> { in to_socket_addr() argument
151 impl FromStr for SocketAddr { implementation
156 fn from_str(s: &str) -> Result<SocketAddr, AddrParseError> { in from_str() argument
[all …]
Dnet.rs8 use std::net::{SocketAddr, SocketAddrV4, SocketAddrV6, TcpListener, TcpStream, ToSocketAddrs};
24 pub fn from_sockaddr(s: &SocketAddr) -> Self { in from_sockaddr()
26 SocketAddr::V4(_) => InetVersion::V4, in from_sockaddr()
27 SocketAddr::V6(_) => InetVersion::V6, in from_sockaddr()
99 SocketAddr::V4(a) => { in bind()
110 SocketAddr::V6(a) => { in bind()
138 SocketAddr::V4(a) => { in connect()
149 SocketAddr::V6(a) => { in connect()
/external/rust/crates/mio/src/net/
Dudp.rs16 use std::net::{Ipv4Addr, Ipv6Addr, SocketAddr};
121 pub fn bind(addr: SocketAddr) -> io::Result<UdpSocket> { in bind()
160 pub fn local_addr(&self) -> io::Result<SocketAddr> { in local_addr() argument
188 pub fn send_to(&self, buf: &[u8], target: SocketAddr) -> io::Result<usize> { in send_to()
223 pub fn recv_from(&self, buf: &mut [u8]) -> io::Result<(usize, SocketAddr)> { in recv_from() argument
259 pub fn peek_from(&self, buf: &mut [u8]) -> io::Result<(usize, SocketAddr)> { in peek_from() argument
300 pub fn connect(&self, addr: SocketAddr) -> io::Result<()> { in connect()
/external/rust/crates/tokio/src/net/tcp/
Dlistener.rs8 use std::net::{self, SocketAddr};
117 fn bind_addr(addr: SocketAddr) -> io::Result<TcpListener> { in bind_addr()
149 pub async fn accept(&self) -> io::Result<(TcpStream, SocketAddr)> { in accept() argument
166 pub fn poll_accept(&self, cx: &mut Context<'_>) -> Poll<io::Result<(TcpStream, SocketAddr)>> { in poll_accept() argument
293 pub fn local_addr(&self) -> io::Result<SocketAddr> { in local_addr() argument
Dsocket.rs5 use std::net::SocketAddr;
373 pub fn local_addr(&self) -> io::Result<SocketAddr> { in local_addr() argument
405 pub fn bind(&self, addr: SocketAddr) -> io::Result<()> { in bind()
441 pub async fn connect(self, addr: SocketAddr) -> io::Result<TcpStream> { in connect()
/external/rust/crates/mio/src/net/tcp/
Dlistener.rs1 use std::net::{self, SocketAddr};
52 pub fn bind(addr: SocketAddr) -> io::Result<TcpListener> { in bind()
89 pub fn accept(&self) -> io::Result<(TcpStream, SocketAddr)> { in accept() argument
96 pub fn local_addr(&self) -> io::Result<SocketAddr> { in local_addr() argument
/external/rust/crates/mio/src/net/uds/
Dlistener.rs2 use crate::net::{SocketAddr, UnixStream};
37 pub fn accept(&self) -> io::Result<(UnixStream, SocketAddr)> { in accept() argument
42 pub fn local_addr(&self) -> io::Result<sys::SocketAddr> { in local_addr() argument

123