Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ingangi committed Apr 14, 2020
1 parent 567b090 commit bd6d039
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion engin/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ std::shared_ptr<curl_rsp_t> engine_t::exec_curl(const std::string & url
return nullptr;
}

curl_stub_t *stub = dynamic_cast<curl_stub_t *>(iter->second.get());
curl_stub_t *stub = static_cast<curl_stub_t *>(iter->second.get());
if (stub == nullptr) {
SPDLOG(ERROR, "{} failed: curl_stub_t * is nullptr", __FUNCTION__);
return nullptr;
Expand Down
2 changes: 1 addition & 1 deletion examples/rpc_example/test_client/test_client_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ int main(int argc, char **argv)
ENGINE_INIT(1);

ENGIN.create_chroutine([](void *){
grpc_async_client_t *client = dynamic_cast<grpc_async_client_t *>(grpc_async_client_t::create("127.0.0.1:50061").get());
grpc_async_client_t *client = static_cast<grpc_async_client_t *>(grpc_async_client_t::create("127.0.0.1:50061").get());
if (client == nullptr) {
SPDLOG(INFO, "grpc_async_client_t::create failed");
return;
Expand Down
2 changes: 1 addition & 1 deletion examples/rpc_example/test_server_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ int main(int argc, char **argv)
{
ENGINE_INIT(1);
ENGIN.create_chroutine([](void *){
test_rpc_server *server = dynamic_cast<test_rpc_server *>(test_rpc_server::create().get());
test_rpc_server *server = static_cast<test_rpc_server *>(test_rpc_server::create().get());
if (server == nullptr || server->start("0.0.0.0:50061") != 0) {
SPDLOG(INFO, "test_rpc_server start failed");
}
Expand Down
2 changes: 1 addition & 1 deletion examples/tcp_echo_server_example/test_echo_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ int main(int argc, char **argv)
ENGINE_INIT(3);

ENGIN.create_chroutine([&](void *){
raw_tcp_server_t* server = static_cast<raw_tcp_server_t*>(raw_tcp_server_t::create("0.0.0.0", "30000").get());
raw_tcp_server_t* server = static_cast<raw_tcp_server_t*>(raw_tcp_server_t::create("0.0.0.0", "50061").get());
if (server) {
server->start();
while (1) {
Expand Down
2 changes: 0 additions & 2 deletions net/epoll/raw_tcp_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ class raw_tcp_server_t: public epoll_handler_sink_it, public selectable_object_i
std::string m_port;
raw_data_chan_t m_read_chan;
raw_data_chan_t m_write_chan;
// chan_selecter_t m_write_selecter;
// raw_data_block_sptr_t m_data_block_for_write = nullptr;
};

}
2 changes: 1 addition & 1 deletion net/epoll/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ socket_t::socket_t(protocol_t protocol, int sock_flags, poll_sptr_t poller, epol
assert(m_poller != nullptr && m_sink != nullptr);
assert(m_protocol == protocol_t::tcp); //for now
int sock_type = m_protocol == protocol_t::tcp ? SOCK_STREAM : SOCK_DGRAM;
m_fd = socket(AF_UNSPEC, sock_type, sock_flags);
m_fd = socket(AF_INET/*AF_UNSPEC*/, sock_type, sock_flags);
if (m_fd > 0) {
after_create();
}
Expand Down
2 changes: 1 addition & 1 deletion net/rpc/grpc_sync_client_for_chroutine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class client_sync_call_t : public client_call_it
{}

::grpc::StatusCode call_sync(RESULT_T &result) {
client_sync_call_t<RESULT_T> *call_ptr = dynamic_cast<client_sync_call_t<RESULT_T> *>(call());
client_sync_call_t<RESULT_T> *call_ptr = static_cast<client_sync_call_t<RESULT_T> *>(call());
if (call_ptr) {
call_ptr->wait_call();
result = call_ptr->m_result;
Expand Down
2 changes: 1 addition & 1 deletion util/timer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class chr_timer_t : public selectable_object_it
if (s_this.get() == nullptr) {
delete p_this;
}
return dynamic_cast<chr_timer_t *>(s_this.get());
return static_cast<chr_timer_t *>(s_this.get());
}

// if the timer is no more use, call this to detach from engin.
Expand Down

0 comments on commit bd6d039

Please sign in to comment.