Lines Matching refs:socket
11 use crate::socket::WakerRegistration;
12 use crate::socket::{Context, PollAt};
2401 socket: Socket<'static>, field
2408 &self.socket in deref()
2414 &mut self.socket in deref_mut()
2419 socket: &mut TestSocket, in send()
2423 socket.cx.set_now(timestamp); in send()
2434 assert!(socket.socket.accepts(&mut socket.cx, &ip_repr, repr)); in send()
2436 match socket.socket.process(&mut socket.cx, &ip_repr, repr) { in send()
2445 fn recv<F>(socket: &mut TestSocket, timestamp: Instant, mut f: F) in recv()
2449 socket.cx.set_now(timestamp); in recv()
2452 let result = socket in recv()
2453 .socket in recv()
2454 .dispatch(&mut socket.cx, |_, (ip_repr, tcp_repr)| { in recv()
2470 fn recv_nothing(socket: &mut TestSocket, timestamp: Instant) { in recv_nothing()
2471 socket.cx.set_now(timestamp); in recv_nothing()
2473 let result: Result<(), ()> = socket in recv_nothing()
2474 .socket in recv_nothing()
2475 .dispatch(&mut socket.cx, |_, (_ip_repr, _tcp_repr)| { in recv_nothing()
2483 ($socket:ident, $repr:expr) =>
2484 (send!($socket, time 0, $repr));
2485 ($socket:ident, $repr:expr, $result:expr) =>
2486 (send!($socket, time 0, $repr, $result));
2487 ($socket:ident, time $time:expr, $repr:expr) =>
2488 (send!($socket, time $time, $repr, None));
2489 ($socket:ident, time $time:expr, $repr:expr, $result:expr) =>
2490 (assert_eq!(send(&mut $socket, Instant::from_millis($time), &$repr), $result));
2494 ($socket:ident, [$( $repr:expr ),*]) => ({
2495 $( recv!($socket, Ok($repr)); )*
2496 recv_nothing!($socket)
2498 ($socket:ident, $result:expr) =>
2499 (recv!($socket, time 0, $result));
2500 ($socket:ident, time $time:expr, $result:expr) =>
2501 (recv(&mut $socket, Instant::from_millis($time), |result| {
2509 ($socket:ident, time $time:expr, $result:expr, exact) =>
2510 (recv(&mut $socket, Instant::from_millis($time), |repr| assert_eq!(repr, $result)));
2514 ($socket:ident) => (recv_nothing!($socket, time 0));
2515 … ($socket:ident, time $time:expr) => (recv_nothing(&mut $socket, Instant::from_millis($time)));
2533 fn socket() -> TestSocket { in socket() function
2540 let mut socket = Socket::new(rx_buffer, tx_buffer); in socket_with_buffer_sizes() localVariable
2541 socket.set_ack_delay(None); in socket_with_buffer_sizes()
2543 TestSocket { socket, cx } in socket_with_buffer_sizes()
2665 let mut s = socket(); in test_closed_reject()
2672 assert!(!s.socket.accepts(&mut s.cx, &SEND_IP_TEMPL, &tcp_repr)); in test_closed_reject()
2677 let mut s = socket(); in test_closed_reject_after_listen()
2685 assert!(!s.socket.accepts(&mut s.cx, &SEND_IP_TEMPL, &tcp_repr)); in test_closed_reject_after_listen()
2690 let mut s = socket(); in test_closed_close()
2699 let mut s = socket(); in socket_listen()
2803 let mut s = socket(); in test_listen_sanity()
2810 let mut s = socket(); in test_listen_validation()
2816 let mut s = socket(); in test_listen_twice()
2846 assert!(!s.socket.accepts(&mut s.cx, &SEND_IP_TEMPL, &tcp_repr)); in test_listen_syn_reject_ack()
3123 let mut s = socket(); in test_connect_validation()
3125 s.socket in test_connect_validation()
3130 s.socket in test_connect_validation()
3135 s.socket in test_connect_validation()
3139 s.socket in test_connect_validation()
3147 let mut s = socket(); in test_connect()
3149 s.socket in test_connect()
3181 let mut s = socket(); in test_connect_unspecified_local()
3182 assert_eq!(s.socket.connect(&mut s.cx, REMOTE_END, 80), Ok(())); in test_connect_unspecified_local()
3187 let mut s = socket(); in test_connect_specified_local()
3189 s.socket.connect(&mut s.cx, REMOTE_END, (REMOTE_ADDR, 80)), in test_connect_specified_local()
3196 let mut s = socket(); in test_connect_twice()
3197 assert_eq!(s.socket.connect(&mut s.cx, REMOTE_END, 80), Ok(())); in test_connect_twice()
3199 s.socket.connect(&mut s.cx, REMOTE_END, 80), in test_connect_twice()
3206 let mut s = socket(); in test_syn_sent_sanity()
3208 s.socket.connect(&mut s.cx, REMOTE_END, LOCAL_END).unwrap(); in test_syn_sent_sanity()
3436 let mut s = socket(); in test_syn_sent_close()
3460 s.socket.connect(&mut s.cx, REMOTE_END, LOCAL_END).unwrap(); in test_syn_sent_win_scale_buffers()
4537 let mut s = socket(); in test_listen()
6026 assert_eq!(s.socket.poll_at(&mut s.cx), PollAt::Ingress); in test_listen_timeout()
6031 let mut s = socket(); in test_connect_timeout()
6033 s.socket in test_connect_timeout()
6048 s.socket.poll_at(&mut s.cx), in test_connect_timeout()
6067 s.socket.poll_at(&mut s.cx), in test_established_timeout()
6071 assert_eq!(s.socket.poll_at(&mut s.cx), PollAt::Now); in test_established_timeout()
6079 s.socket.poll_at(&mut s.cx), in test_established_timeout()
6089 s.socket.poll_at(&mut s.cx), in test_established_timeout()
6114 s.socket.poll_at(&mut s.cx), in test_established_keep_alive_timeout()
6123 s.socket.poll_at(&mut s.cx), in test_established_keep_alive_timeout()
6134 s.socket.poll_at(&mut s.cx), in test_established_keep_alive_timeout()
6192 assert_eq!(s.socket.poll_at(&mut s.cx), PollAt::Now); in test_closed_timeout()
6199 assert_eq!(s.socket.poll_at(&mut s.cx), PollAt::Ingress); in test_closed_timeout()
6230 assert_eq!(s.socket.poll_at(&mut s.cx), PollAt::Now); in test_sends_keep_alive()
6239 s.socket.poll_at(&mut s.cx), in test_sends_keep_alive()
6251 s.socket.poll_at(&mut s.cx), in test_sends_keep_alive()
6268 s.socket.poll_at(&mut s.cx), in test_sends_keep_alive()
6290 s.socket.dispatch(&mut s.cx, |_, (ip_repr, _)| { in test_set_hop_limit()
6873 s.socket.close(); in test_final_packet_in_stream_doesnt_wait_for_nagle()
6907 assert!(!s.socket.accepts(&mut s.cx, &SEND_IP_TEMPL, &tcp_repr)); in test_doesnt_accept_wrong_port()
6915 assert!(!s.socket.accepts(&mut s.cx, &SEND_IP_TEMPL, &tcp_repr)); in test_doesnt_accept_wrong_port()
6936 assert!(s.socket.accepts(&mut s.cx, &ip_repr, &tcp_repr)); in test_doesnt_accept_wrong_ip()
6945 assert!(!s.socket.accepts(&mut s.cx, &ip_repr_wrong_src, &tcp_repr)); in test_doesnt_accept_wrong_ip()
6954 assert!(!s.socket.accepts(&mut s.cx, &ip_repr_wrong_dst, &tcp_repr)); in test_doesnt_accept_wrong_ip()