/commonlibrary/rust/ylong_runtime/ylong_io/tests/ |
H A D | udp_socket_test.rs | 31 Ok(socket) => socket, in sdv_send_recv() 38 Ok(socket) => socket, in sdv_send_recv() 45 Ok(socket) => socket, in sdv_send_recv() 51 Ok(socket) => socket, in sdv_send_recv() 91 Ok(socket) => socket, in sdv_send_to_recv_from() [all...] |
/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/windows/udp/ |
H A D | socket.rs | 20 bind as win_bind, closesocket, ioctlsocket, socket, ADDRESS_FAMILY, AF_INET, AF_INET6, FIONBIO, 28 socket: SOCKET, 32 /// Gets new socket 44 let socket = socket_syscall!( in create_socket() 45 socket(domain as i32, socket_type as i32, 0), in create_socket() 50 match socket_syscall!(ioctlsocket(socket, FIONBIO, &mut 1), PartialEq::ne, 0) { in create_socket() 52 let _ = unsafe { closesocket(socket) }; in create_socket() 55 Ok(_) => Ok(UdpSock { socket }), in create_socket() 61 let socket = unsafe { net::UdpSocket::from_raw_socket(self.socket a [all...] |
H A D | mod.rs | 14 mod socket; modules 15 pub(crate) use socket::UdpSock;
|
H A D | udp_socket.rs | 24 /// A UDP socket. 27 /// State is None if the socket has not been Registered. 63 let socket = ConnectedUdpSocket::from_std(self); in connect() 64 socket.inner.connect(addr)?; in connect() 65 Ok(socket) in connect() 69 pub fn from_std(socket: net::UdpSocket) -> UdpSocket { in from_std() 71 inner: socket, in from_std() 76 /// Returns the socket address that this socket was created from. 86 /// let socket [all...] |
/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/windows/tcp/ |
H A D | socket.rs | 23 closesocket, ioctlsocket, setsockopt, socket, ADDRESS_FAMILY, AF_INET, AF_INET6, FIONBIO, 30 socket: SOCKET, 34 /// Gets new socket 46 let socket = socket_syscall!( in create_socket() 47 socket(domain as i32, socket_type as i32, 0), in create_socket() 52 match socket_syscall!(ioctlsocket(socket, FIONBIO, &mut 1), PartialEq::ne, 0) { in create_socket() 54 let _ = unsafe { closesocket(socket) }; in create_socket() 58 socket: socket as SOCKET, in create_socket() 69 bind(self.socket a [all...] |
H A D | listener.rs | 24 /// A TCP socket server, listening for connections. 27 /// State is None if the socket has not been Registered. 44 let socket = TcpSocket::new_socket(addr)?; in bind() 45 let listener = unsafe { TcpListener::from_raw_socket(socket.as_raw_socket() as _) }; in bind() 47 socket.bind(addr)?; in bind() 48 socket.listen(1024)?; in bind() 78 /// Returns the local socket address of this listener. 93 /// Gets the value of the IP_TTL option for this socket. 108 /// Sets the value for the IP_TTL option on this socket. 110 /// from this socket [all...] |
H A D | mod.rs | 17 mod socket; modules 18 pub(crate) use socket::TcpSocket;
|
H A D | stream.rs | 22 use crate::sys::windows::tcp::socket::{get_sock_linger, set_sock_linger}; 27 /// A non-blocking TCP Stream between a local socket and a remote socket. 29 /// Raw TCP socket 31 /// State is None if the socket has not been Registered. 45 let socket = TcpSocket::new_socket(addr)?; in connect() 46 let stream = unsafe { TcpStream::from_raw_socket(socket.as_raw_socket() as _) }; in connect() 48 socket.connect(addr)?; in connect() 68 /// Returns the socket address of the local half of this TCP connection. 88 /// Returns the socket addres [all...] |
/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/unix/uds/ |
H A D | listener.rs | 22 use crate::sys::socket::set_non_block; 32 /// Creates a new `UnixListener` bound to the specified socket. 38 /// if let Ok(sock) = UnixListener::bind("/socket/path") { 39 /// println!("socket binds successfully"); 43 super::socket::bind(path.as_ref()).map(UnixListener::from_std) in bind() 53 /// let listener = UnixListener::bind("/socket/path")?; 55 /// if let Ok((socket, addr)) = listener.accept() { 67 let socket = { in accept() 75 .map(|socket| unsafe { net::UnixStream::from_raw_fd(socket) }) in accept() [all...] |
H A D | socket.rs | 23 use crate::sys::socket::set_non_block; 24 use crate::sys::socket::socket_new; 30 let socket = socket_new(AF_UNIX, libc::SOCK_STREAM)?; 31 let net = unsafe { net::UnixListener::from_raw_fd(socket) }; 33 syscall!(bind(socket, socket_addr, addr_length))?; 35 syscall!(listen(socket, 1024))?; 44 let socket = socket_new(AF_UNIX, libc::SOCK_STREAM)?; 45 let net = unsafe { net::UnixStream::from_raw_fd(socket) }; 46 match syscall!(connect(socket, sockaddr, addr_length)) { 53 let socket [all...] |
H A D | datagram.rs | 22 /// A Unix datagram socket. 34 /// if let Ok(socket) = UnixDatagram::bind("/socket/path") { 35 /// println!("socket binds successfully"); 39 super::socket::data_gram_bind(path.as_ref()).map(Self::from_std) in bind() 50 /// if let Ok(socket) = UnixDatagram::bind("/path/to/the/socket") { 51 /// println!("socket binds successfully"); 52 /// let ylong_sock = YlongUnixDatagram::from_std(socket); 55 pub fn from_std(socket [all...] |
H A D | mod.rs | 14 mod socket; modules
|
H A D | stream.rs | 29 /// Connects to the specific socket. 36 /// println!("socket connection succeeds"); 40 super::socket::connect(path.as_ref()).map(UnixStream::from_std) in connect() 51 /// if let Ok(stream) = UnixStream::connect("/path/to/the/socket") { 52 /// println!("socket binds successfully"); 68 /// println!("unix socket pair created successfully"); 72 super::socket::stream_pair().map(|(stream1, stream2)| { in pair() 77 /// Creates a new independently owned handle to the underlying socket. 84 /// let socket = UnixStream::connect("/tmp/sock")?; 85 /// let sock_copy = socket [all...] |
/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/unix/udp/ |
H A D | socket.rs | 21 use crate::sys::socket::socket_new; 25 socket: c_int, 38 let socket = socket_new(domain, socket_type)?; 40 socket: socket as c_int, 46 inner: unsafe { net::UdpSocket::from_raw_fd(self.socket) }, 49 match syscall!(bind(self.socket, raw_addr.as_ptr(), addr_length)) { 58 self.socket in as_raw_fd() 64 UdpSock { socket: fd } in from_raw_fd()
|
H A D | mod.rs | 16 mod socket; modules 17 pub(crate) use socket::UdpSock;
|
H A D | udp_socket.rs | 47 /// Ok(socket) => socket, 53 /// Ok(socket) => socket, 70 /// Creates a UDP socket from the given address. 83 /// println!("socket binds successfully"); 89 let socket = UdpSock::new_socket(addr)?; in bind() 90 socket.bind(addr) in bind() 95 /// This function is intended to be used to wrap a UDP socket from the 97 /// about the underlying socket; i [all...] |
/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/unix/tcp/ |
H A D | listener.rs | 24 use crate::sys::socket::set_non_block; 27 /// A socket server. 36 /// The socket will be set to `SO_REUSEADDR`. 38 let socket = TcpSocket::new_socket(addr)?; in bind() 40 inner: unsafe { net::TcpListener::from_raw_fd(socket.as_raw_fd()) }, in bind() 42 socket.set_reuse(true)?; in bind() 43 socket.bind(addr)?; in bind() 44 socket.listen(1024)?; in bind() 67 Ok(socket) => unsafe { net::TcpStream::from_raw_fd(socket) }, in accept() [all...] |
H A D | socket.rs | 28 use crate::sys::unix::socket::socket_new; 31 socket: c_int, 44 let socket = socket_new(domain, socket_type)?; 46 socket: socket as c_int, 54 self.socket, 67 match syscall!(bind(self.socket, raw_addr.as_ptr(), addr_length)) { 74 syscall!(listen(self.socket, max_connect))?; 80 inner: unsafe { net::TcpStream::from_raw_fd(self.socket) }, 83 match syscall!(connect(self.socket, raw_add [all...] |
H A D | mod.rs | 19 mod socket; modules 20 pub(crate) use socket::TcpSocket;
|
H A D | stream.rs | 21 use crate::sys::unix::tcp::socket::{get_sock_linger, set_sock_linger}; 24 /// A non-blocking TCP Stream between a local socket and a remote socket. 26 /// Raw TCP socket 34 let socket = TcpSocket::new_socket(addr)?; in connect() 35 socket.connect(addr) in connect() 50 /// Returns the socket address of the local half of this TCP connection. 70 /// Returns the socket address of the remote half of this TCP connection. 121 /// Gets the value of the linger on this socket by getting `SO_LINGER` 137 /// Sets the value of the linger on this socket b [all...] |
/commonlibrary/rust/ylong_runtime/ylong_runtime/benches/bin/ |
H A D | ylong_tokio_tcp_perf.rs | 116 let (mut socket, _) = listener.accept().await.unwrap(); in main() 120 let _ = match socket.read(&mut buf).await { in main() 135 let _ = socket.write(b"hello client").await.unwrap(); in main() 160 let (mut socket, _) = listener.accept().await.unwrap(); in main() 164 let _ = match socket.read(&mut buf).await { in main() 179 let _ = socket.write(b"hello client").await.unwrap(); in main()
|
/commonlibrary/rust/ylong_runtime/ylong_runtime/tests/ |
H A D | uds_cargo_test.rs | 167 let socket = UnixDatagram::bind(PATH).unwrap(); in sdv_uds_datagram_test() 170 socket.recv(buf.as_mut_slice()).await.expect("recv failed"); in sdv_uds_datagram_test() 178 let socket = UnixDatagram::unbound().unwrap(); in sdv_uds_datagram_test() 180 if socket.connect(PATH).is_ok() { in sdv_uds_datagram_test() 181 socket.send(b"hello world").await.expect("send failed"); in sdv_uds_datagram_test()
|
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/net/sys/ |
H A D | udp.rs | 49 /// Ok(socket) => socket, 55 /// Ok(socket) => socket, 89 /// Creates a new UDP socket and attempts to bind it to the address provided 124 pub(crate) fn new(socket: ylong_io::UdpSocket) -> io::Result<Self> { 125 let source = AsyncSource::new(socket, None)?; 156 /// Ok(socket) => socket, 173 let socket [all...] |
/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/unix/ |
H A D | source_fd.rs | 44 use crate::sys::{socket, SourceFd}; 53 let sock = socket::socket_new(libc::AF_UNIX, libc::SOCK_STREAM).unwrap(); in ut_source_fd_debug_info()
|
/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/windows/ |
H A D | net.rs | 32 /// State is None if the socket has not been Registered. 42 /// Register the socket to [`Selector`] 50 socket: RawSocket, in register() 54 None => selector.register(socket, token, interests).map(|state| { in register() 60 /// Deregister the socket 97 /// This structure used to re-register the socket when Err(WouldBlock) occurs
|