Skip to content
This repository has been archived by the owner on Feb 10, 2018. It is now read-only.

How to close the connection in server side? #27

Open
zoumi opened this issue Oct 14, 2017 · 2 comments
Open

How to close the connection in server side? #27

zoumi opened this issue Oct 14, 2017 · 2 comments

Comments

@zoumi
Copy link

zoumi commented Oct 14, 2017

It seems that return Box::new(future::done(Ok(req))) doesn't close the connection.
My client side:

        let mut socket = TcpStream::connect(addr).unwrap();
        socket.write(msg.as_bytes());

        let mut result = String::new();

        println!("waitiing for server to return");
        let response = socket.read_to_string(&mut result);
        info!("the server return: {}", result);

will block at socket.read_to_string()

@khaledkbadr
Copy link

khaledkbadr commented Jan 5, 2018

@zoumi have you found a way to do it?

@zoumi
Copy link
Author

zoumi commented Jan 10, 2018

Not really. I read data to buf with a fixed len, print it, then eixit the client process.(I don't care what server returns in that app).
I don't understand what alexcricht said. We can not close connection at server side?
Should I close this issue?

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants