Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The tcp json server example not worked! #678

Open
duanwujie opened this issue Sep 15, 2022 · 3 comments
Open

The tcp json server example not worked! #678

duanwujie opened this issue Sep 15, 2022 · 3 comments

Comments

@duanwujie
Copy link

duanwujie commented Sep 15, 2022

use jsonrpc_tcp_server::ServerBuilder;
use jsonrpc_core::*;
fn tcp_server() {

    let mut io = IoHandler::default();
    io.add_sync_method("say_hello", |_params| {
        Ok(Value::String("hello".to_string()))
    });
    let server = ServerBuilder::new(io)
        .start(&"0.0.0.0:3030".parse().unwrap())
        .expect("Server must start with no issues.");

    server.wait();
}

The server.wait() didn't blocked , json_tcp_server version is 18.0.0

@manuelinfosec
Copy link

I figured this by bumping down to 16.0.0 version, but now it isn't accepting new requests.

@ilya-bobyr
Copy link

It seems to be working if I switch to jsonrpc_http_server.
Version 16.0.0 uses a very old tokio library.

@vCassius
Copy link

same question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants