Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.

Commit

Permalink
bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Madoka authored and Madoka committed Nov 1, 2016
1 parent 80c1d72 commit 5ef5f1a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions example/pub_sub_example/pub_client_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ int main(void)
while (true)
{
using namespace std::chrono_literals;
//async_client->call(endpoint, client::add_pub, lhs, rhs++);
//std::this_thread::sleep_for(1s);
async_client->pub(endpoint, client::sub_add, rhs++);
std::this_thread::sleep_for(1s);
async_client->call(endpoint, client::add_pub, lhs, rhs++);
std::this_thread::sleep_for(200ms);
async_client->pub(endpoint, client::sub_add, rhs);
std::this_thread::sleep_for(200ms);
}
}
catch (timax::rpc::exception const& e)
Expand Down
5 changes: 5 additions & 0 deletions rest_rpc/client/detail/async_client_private.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ namespace timax { namespace rpc
sub_manager_.sub(endpoint, protocol, std::forward<Func>(func), std::forward<EFunc>(efunc));
}

uint64_t hash(std::string const& topic) const
{
return hash_(topic);
}

private:
io_service_t& ios_;
rpc_manager_t rpc_manager_;
Expand Down
1 change: 1 addition & 0 deletions rest_rpc/client/detail/async_sub_channel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ namespace timax { namespace rpc
if (!(connection_.socket().is_open() && running_flag_.load()))
return;

std::memset(&send_head_, 0, sizeof(req_header));
if (!error)
{
async_read(connection_.socket(), boost::asio::buffer(&recv_head_, sizeof(recv_head_)), boost::bind(
Expand Down

0 comments on commit 5ef5f1a

Please sign in to comment.