Lines Matching refs:new
27 … pub static ref SOCKET_SET: SpinLock<SocketSet<'static >> = SpinLock::new(SocketSet::new(vec![]));
30 pub static ref PORT_MANAGER: PortManager = PortManager::new();
43 pub fn new() -> Self { in new() method
45 tcp_port_table: SpinLock::new(HashMap::new()), in new()
46 udp_port_table: SpinLock::new(HashMap::new()), in new()
136 pub fn new(handle: SocketHandle) -> Arc<Self> { in new() method
137 return Arc::new(Self(handle)); in new()
200 fn new( in new() method
245 pub fn new(protocol: Protocol, options: SocketOptions) -> Self { in new() method
246 let tx_buffer = raw::PacketBuffer::new( in new()
250 let rx_buffer = raw::PacketBuffer::new( in new()
255 let socket = raw::Socket::new( in new()
264 GlobalSocketHandle::new(SOCKET_SET.lock().add(socket)); in new()
266 let metadata = SocketMetadata::new( in new()
400 return Box::new(self.clone()); in box_clone()
428 pub fn new(options: SocketOptions) -> Self { in new() method
429 let tx_buffer = udp::PacketBuffer::new( in new()
433 let rx_buffer = udp::PacketBuffer::new( in new()
437 let socket = udp::Socket::new(tx_buffer, rx_buffer); in new()
441 GlobalSocketHandle::new(SOCKET_SET.lock().add(socket)); in new()
443 let metadata = SocketMetadata::new( in new()
530 wire::IpAddress::Ipv4(_) => Endpoint::Ip(Some(wire::IpEndpoint::new( in write()
534 wire::IpAddress::Ipv6(_) => Endpoint::Ip(Some(wire::IpEndpoint::new( in write()
602 return Box::new(self.clone()); in box_clone()
616 let result = wire::IpEndpoint::new( in endpoint()
656 pub fn new(options: SocketOptions) -> Self { in new() method
657 let tx_buffer = tcp::SocketBuffer::new(vec![0; Self::DEFAULT_TX_BUF_SIZE]); in new()
658 let rx_buffer = tcp::SocketBuffer::new(vec![0; Self::DEFAULT_RX_BUF_SIZE]); in new()
659 let socket = tcp::Socket::new(tx_buffer, rx_buffer); in new()
663 GlobalSocketHandle::new(SOCKET_SET.lock().add(socket)); in new()
665 let metadata = SocketMetadata::new( in new()
920 let rx_buffer = tcp::SocketBuffer::new(vec![0; Self::DEFAULT_RX_BUF_SIZE]); in accept()
921 let tx_buffer = tcp::SocketBuffer::new(vec![0; Self::DEFAULT_TX_BUF_SIZE]); in accept()
923 let mut tcp_socket = tcp::Socket::new(rx_buffer, tx_buffer); in accept()
931 let new_handle = GlobalSocketHandle::new(sockets.add(tcp_socket)); in accept()
942 Box::new(TcpSocket { in accept()
986 return Box::new(self.clone()); in box_clone()
1126 pub fn new(socket: Box<dyn Socket>) -> Arc<Self> { in new() method
1127 return Arc::new(Self(SpinLock::new(socket))); in new()