Lines Matching refs:Endpoint
21 use super::{net_core::poll_ifaces, Endpoint, Protocol, Socket, NET_DRIVERS};
161 fn read(&self, buf: &mut [u8]) -> (Result<usize, SystemError>, Endpoint) { in read() argument
173 Endpoint::Ip(Some(smoltcp::wire::IpEndpoint { in read()
182 return (Err(SystemError::EAGAIN_OR_EWOULDBLOCK), Endpoint::Ip(None)); in read()
192 fn write(&self, buf: &[u8], to: Option<super::Endpoint>) -> Result<usize, SystemError> { in write()
208 if let Some(Endpoint::Ip(Some(endpoint))) = to { in write()
269 fn connect(&mut self, _endpoint: super::Endpoint) -> Result<(), SystemError> { in connect()
288 remote_endpoint: Option<Endpoint>, // 记录远程endpoint提供给connect(), 应该使用IP地址。
327 fn do_bind(&self, socket: &mut udp::Socket, endpoint: Endpoint) -> Result<(), SystemError> { in do_bind()
328 if let Endpoint::Ip(Some(ip)) = endpoint { in do_bind()
347 fn read(&self, buf: &mut [u8]) -> (Result<usize, SystemError>, Endpoint) { in read() argument
361 return (Ok(size), Endpoint::Ip(Some(remote_endpoint))); in read()
373 fn write(&self, buf: &[u8], to: Option<super::Endpoint>) -> Result<usize, SystemError> { in write()
376 if let Some(Endpoint::Ip(Some(ref endpoint))) = to { in write()
378 } else if let Some(Endpoint::Ip(Some(ref endpoint))) = self.remote_endpoint { in write()
396 wire::IpAddress::Ipv4(_) => Endpoint::Ip(Some(wire::IpEndpoint::new( in write()
400 wire::IpAddress::Ipv6(_) => Endpoint::Ip(Some(wire::IpEndpoint::new( in write()
430 fn bind(&mut self, endpoint: Endpoint) -> Result<(), SystemError> { in bind()
445 fn connect(&mut self, endpoint: super::Endpoint) -> Result<(), SystemError> { in connect()
446 if let Endpoint::Ip(_) = endpoint { in connect()
471 fn endpoint(&self) -> Option<Endpoint> { in endpoint() argument
488 return Some(Endpoint::Ip(Some(result))); in endpoint()
492 fn peer_endpoint(&self) -> Option<Endpoint> { in peer_endpoint() argument
566 fn read(&self, buf: &mut [u8]) -> (Result<usize, SystemError>, Endpoint) { in read() argument
577 return (Err(SystemError::ENOTCONN), Endpoint::Ip(None)); in read()
588 return (Err(SystemError::ENOTCONN), Endpoint::Ip(None)); in read()
594 return (Ok(size), Endpoint::Ip(Some(endpoint))); in read()
601 return (Err(SystemError::ENOTCONN), Endpoint::Ip(None)); in read()
604 return (Err(SystemError::ENOTCONN), Endpoint::Ip(None)); in read()
609 return (Err(SystemError::ENOTCONN), Endpoint::Ip(None)); in read()
617 fn write(&self, buf: &[u8], _to: Option<super::Endpoint>) -> Result<usize, SystemError> { in write()
666 fn connect(&mut self, endpoint: Endpoint) -> Result<(), SystemError> { in connect()
670 if let Endpoint::Ip(Some(ip)) = endpoint { in connect()
737 fn bind(&mut self, endpoint: Endpoint) -> Result<(), SystemError> { in bind()
738 if let Endpoint::Ip(Some(mut ip)) = endpoint { in bind()
757 fn accept(&mut self) -> Result<(Box<dyn Socket>, Endpoint), SystemError> { in accept() argument
799 return Ok((new_socket, Endpoint::Ip(Some(remote_ep)))); in accept()
807 fn endpoint(&self) -> Option<Endpoint> { in endpoint() argument
808 let mut result: Option<Endpoint> = in endpoint()
809 self.local_endpoint.clone().map(|x| Endpoint::Ip(Some(x))); in endpoint()
815 result = Some(Endpoint::Ip(Some(ep))); in endpoint()
821 fn peer_endpoint(&self) -> Option<Endpoint> { in peer_endpoint() argument
824 return socket.remote_endpoint().map(|x| Endpoint::Ip(Some(x))); in peer_endpoint()