Skip to content

Commit

Permalink
fix callback did not overwrite TrafficData
Browse files Browse the repository at this point in the history
  • Loading branch information
garryyan committed Dec 29, 2016
1 parent 3b52bc7 commit 4b261ce
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions samples/Mac/PublicComponentV2/stn_callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ class StnCallBack : public Callback {
static void Release();

virtual bool MakesureAuthed();

//流量统计
virtual void TrafficData(ssize_t _send, ssize_t _recv);

//底层询问上层该host对应的ip列表
virtual std::vector<std::string> OnNewDns(const std::string& _host);
//网络层收到push消息回调
Expand Down
4 changes: 4 additions & 0 deletions samples/Mac/PublicComponentV2/stn_callback.mm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
return true;
}

void StnCallBack::TrafficData(ssize_t _send, ssize_t _recv) {
xdebug2(TSF"send:%_, recv:%_", _send, _recv);
}

std::vector<std::string> StnCallBack::OnNewDns(const std::string& _host) {
std::vector<std::string> vector;
return vector;
Expand Down
4 changes: 4 additions & 0 deletions samples/iOS/iOSDemo/PublicComponentV2/stn_callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ class StnCallBack : public Callback {
static void Release();

virtual bool MakesureAuthed();

//流量统计
virtual void TrafficData(ssize_t _send, ssize_t _recv);

//底层询问上层该host对应的ip列表
virtual std::vector<std::string> OnNewDns(const std::string& _host);
//网络层收到push消息回调
Expand Down
5 changes: 5 additions & 0 deletions samples/iOS/iOSDemo/PublicComponentV2/stn_callback.mm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
return true;
}


void StnCallBack::TrafficData(ssize_t _send, ssize_t _recv) {
xdebug2(TSF"send:%_, recv:%_", _send, _recv);
}

std::vector<std::string> StnCallBack::OnNewDns(const std::string& _host) {
std::vector<std::string> vector;
vector.push_back("118.89.24.72");
Expand Down

0 comments on commit 4b261ce

Please sign in to comment.