|
|
@@ -353,11 +353,11 @@ impl HtxSwapWs {
|
|
|
//心跳包
|
|
|
let ping = json_value["ping"].as_i64();
|
|
|
match ping {
|
|
|
- Some(_) => {
|
|
|
+ Some(ping_ts) => {
|
|
|
let pong = json!({
|
|
|
- "pong": Utc::now().timestamp()/100
|
|
|
+ "pong": ping_ts
|
|
|
});
|
|
|
- return ResponseData::new("".to_string(), -301, "success".to_string(), pong);
|
|
|
+ return ResponseData::new("".to_string(), -302, "success".to_string(), pong);
|
|
|
}
|
|
|
None => {}
|
|
|
}
|
|
|
@@ -411,11 +411,12 @@ impl HtxSwapWs {
|
|
|
return res_data;
|
|
|
}
|
|
|
"ping" => {
|
|
|
+ let ts = json_value["ts"].as_str().unwrap();
|
|
|
let pong = json!({
|
|
|
"op": "pong",
|
|
|
- "ts": Utc::now().timestamp()
|
|
|
+ "ts": ts
|
|
|
});
|
|
|
- return ResponseData::new("".to_string(), -301, "success".to_string(), pong);
|
|
|
+ return ResponseData::new("".to_string(), -302, "success".to_string(), pong);
|
|
|
}
|
|
|
"sub" => {
|
|
|
res_data.channel = json_value["topic"].as_str().unwrap().to_string();
|