Lines Matching refs:socket

14     socket::{self, raw, tcp, udp},
69 let socket: Box<dyn Socket> = match address_family { in new_socket() localVariable
90 let handle_item = SocketHandleItem::new(Arc::downgrade(&socket.posix_item())); in new_socket()
93 .insert(socket.socket_handle(), handle_item); in new_socket()
94 Ok(socket) in new_socket()
288 pub fn new(socket: Box<dyn Socket>) -> Arc<Self> { in new()
289 Arc::new(Self(SpinLock::new(socket), AtomicUsize::new(0))) in new()
305 let mut socket = self.0.lock_irqsave(); in do_close() localVariable
307 if socket.metadata().socket_type == SocketType::Unix { in do_close()
311 if let Some(Endpoint::Ip(Some(ip))) = socket.endpoint() { in do_close()
312 PORT_MANAGER.unbind_port(socket.metadata().socket_type, ip.port); in do_close()
315 socket.clear_epoll()?; in do_close()
319 .remove(&socket.socket_handle()) in do_close()
321 socket.close(); in do_close()
783 pub fn poll(socket: &socket::Socket, handle_item: &SocketHandleItem) -> 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, handle_item.is_posix_listen), in poll()
788 socket::Socket::Raw(raw) => Self::raw_poll(raw, shutdown), in poll()
794 socket: &tcp::Socket, in tcp_poll()
803 if socket.is_active() { in tcp_poll()
811 let state = socket.state(); in tcp_poll()
826 if socket.can_recv() { in tcp_poll()
832 if socket.send_queue() < socket.send_capacity() { in tcp_poll()
848 if !socket.is_active() { in tcp_poll()
855 pub fn udp_poll(socket: &udp::Socket, shutdown: ShutdownType) -> EPollEventType { in udp_poll()
867 if socket.can_recv() { in udp_poll()
871 if socket.can_send() { in udp_poll()
885 pub fn raw_poll(socket: &raw::Socket, shutdown: ShutdownType) -> EPollEventType { in raw_poll()
898 if socket.can_recv() { in raw_poll()
905 if socket.can_send() { in raw_poll()