Skip to content

Commit

Permalink
Return Box<... + Send> from ClientBuilder::connect
Browse files Browse the repository at this point in the history
Make it actually useful in multi-threaded environment.
  • Loading branch information
vi authored and Michael Eden committed May 19, 2017
1 parent fbdbc62 commit 7fc8b48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,10 @@ impl<'u> ClientBuilder<'u> {
pub fn connect(
&mut self,
ssl_config: Option<SslConnector>,
) -> WebSocketResult<Client<Box<NetworkStream>>> {
) -> WebSocketResult<Client<Box<NetworkStream + Send>>> {
let tcp_stream = try!(self.establish_tcp(None));

let boxed_stream: Box<NetworkStream> = if
let boxed_stream: Box<NetworkStream + Send> = if
self.url.scheme() == "wss" {
Box::new(try!(self.wrap_ssl(tcp_stream, ssl_config)))
} else {
Expand Down

0 comments on commit 7fc8b48

Please sign in to comment.