tests: Implement JSON-RPC server/client test.

This commit is contained in:
parazyd
2023-08-18 11:40:09 +02:00
parent 44982d320e
commit 1237e5be24
2 changed files with 99 additions and 2 deletions

View File

@@ -73,9 +73,9 @@ async fn read_from_stream(stream: &mut Box<dyn PtStream>, buf: &mut Vec<u8>) ->
Ok(total_read)
}
/// Internal accept function that runs inside a loop for accepting incoming
/// Accept function that should run inside a loop for accepting incoming
/// JSON-RPC requests and passing them to the [`RequestHandler`].
async fn accept(
pub async fn accept(
mut stream: Box<dyn PtStream>,
addr: Url,
rh: Arc<impl RequestHandler + 'static>,