we hawt
This commit is contained in:
parent
86d77d23bb
commit
8adcd08daf
@ -32,6 +32,11 @@ struct Connection {
|
|||||||
impl Handler for Connection {
|
impl Handler for Connection {
|
||||||
fn on_open(&mut self, _: ws::Handshake) -> ws::Result<()> {
|
fn on_open(&mut self, _: ws::Handshake) -> ws::Result<()> {
|
||||||
info!("connected account={:?}", self.account);
|
info!("connected account={:?}", self.account);
|
||||||
|
|
||||||
|
if let Some(ref a) = self.account {
|
||||||
|
self.ws.send(RpcMessage::AccountState(a.clone())).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,7 +109,10 @@ pub fn start(pool: PgPool, events: Events) {
|
|||||||
let response = to_vec(&n).unwrap();
|
let response = to_vec(&n).unwrap();
|
||||||
out.send(Message::Binary(response)).unwrap();
|
out.send(Message::Binary(response)).unwrap();
|
||||||
}
|
}
|
||||||
Err(_) => (),
|
// we done
|
||||||
|
Err(_e) => {
|
||||||
|
break;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user