Lines Matching refs:socket
13 socket::{self, tcp, udp},
61 let socket: Box<dyn Socket> = match address_family { in new_socket() localVariable
83 Ok(socket) in new_socket()
291 pub fn new(socket: Box<dyn Socket>) -> Arc<Self> { in new()
292 Arc::new(Self(SpinLock::new(socket), AtomicUsize::new(0))) in new()
315 let mut socket = self.0.lock_irqsave(); in close() localVariable
317 if socket.metadata().unwrap().socket_type == SocketType::SeqpacketSocket { in close()
321 if let Some(Endpoint::Ip(Some(ip))) = socket.endpoint() { in close()
322 PORT_MANAGER.unbind_port(socket.metadata().unwrap().socket_type, ip.port)?; in close()
325 socket.clear_epoll()?; in close()
329 .remove(&socket.socket_handle()) in close()
401 pub fn new(socket: &Box<dyn Socket>) -> Self { in new()
403 metadata: socket.metadata().unwrap(), in new()
410 pub fn from_socket<A: Socket>(socket: &Box<A>) -> Self { in from_socket()
412 metadata: socket.metadata().unwrap(), in from_socket()
784 pub fn poll(socket: &socket::Socket, shutdown: ShutdownType) -> EPollEventType { in poll()
785 match socket { in poll()
786 socket::Socket::Udp(udp) => Self::udp_poll(udp, shutdown), in poll()
787 socket::Socket::Tcp(tcp) => Self::tcp_poll(tcp, shutdown), in poll()
792 pub fn tcp_poll(socket: &tcp::Socket, shutdown: ShutdownType) -> EPollEventType { in tcp_poll()
794 if socket.is_listening() && socket.is_active() { in tcp_poll()
800 if !socket.is_open() { in tcp_poll()
809 let state = socket.state(); in tcp_poll()
812 if socket.can_recv() { in tcp_poll()
818 if socket.send_queue() < socket.send_capacity() { in tcp_poll()
833 if !socket.is_active() { in tcp_poll()
840 pub fn udp_poll(socket: &udp::Socket, shutdown: ShutdownType) -> EPollEventType { in udp_poll()
852 if socket.can_recv() { in udp_poll()
856 if socket.can_send() { in udp_poll()