Read one native protocol frame from a stream (4-byte length prefix + payload).
(stream: &mut TcpStream)
| 57 | |
| 58 | /// Read one native protocol frame from a stream (4-byte length prefix + payload). |
| 59 | async fn read_json_frame(stream: &mut TcpStream) -> Vec<u8> { |
| 60 | let mut len_buf = [0u8; 4]; |
| 61 | stream |
| 62 | .read_exact(&mut len_buf) |
| 63 | .await |
| 64 | .expect("failed to read frame length"); |
| 65 | let len = u32::from_be_bytes(len_buf) as usize; |
| 66 | let mut payload = vec![0u8; len]; |
| 67 | stream |
| 68 | .read_exact(&mut payload) |
| 69 | .await |
| 70 | .expect("failed to read frame payload"); |
| 71 | payload |
| 72 | } |
| 73 | |
| 74 | #[tokio::test(flavor = "multi_thread", worker_threads = 4)] |
| 75 | async fn native_status_returns_ok_after_gateway_enable() { |
no test coverage detected