更新zltoolkit,适配最新代码

This commit is contained in:
xia-chu
2023-04-28 22:03:16 +08:00
parent 64553797bd
commit cdf97e7605
22 changed files with 26 additions and 26 deletions

View File

@@ -139,7 +139,7 @@ API_EXPORT void API_CALL mk_tcp_session_send(const mk_tcp_session ctx, const cha
API_EXPORT void API_CALL mk_tcp_session_send_buffer_safe(const mk_tcp_session ctx, mk_buffer buffer) {
assert(ctx && buffer);
try {
std::weak_ptr<Session> weak_session = ((SessionForC *) ctx)->shared_from_this();
std::weak_ptr<SocketHelper> weak_session = ((SessionForC *) ctx)->shared_from_this();
auto ref = mk_buffer_ref(buffer);
((SessionForC *) ctx)->async([weak_session, ref]() {
auto session_session = weak_session.lock();
@@ -149,7 +149,7 @@ API_EXPORT void API_CALL mk_tcp_session_send_buffer_safe(const mk_tcp_session ct
mk_buffer_unref(ref);
});
} catch (std::exception &ex) {
WarnL << "can not got the strong pionter of this mk_tcp_session:" << ex.what();
WarnL << "can not got the strong pointer of this mk_tcp_session:" << ex.what();
}
}
@@ -271,7 +271,7 @@ void TcpClientForC::onRecv(const Buffer::Ptr &pBuf) {
}
}
void TcpClientForC::onErr(const SockException &ex) {
void TcpClientForC::onError(const SockException &ex) {
if(_events.on_mk_tcp_client_disconnect){
_events.on_mk_tcp_client_disconnect(_client,ex.getErrCode(),ex.what());
}

View File

@@ -21,7 +21,7 @@ public:
TcpClientForC(mk_tcp_client_events *events) ;
~TcpClientForC() override ;
void onRecv(const toolkit::Buffer::Ptr &pBuf) override;
void onErr(const toolkit::SockException &ex) override;
void onError(const toolkit::SockException &ex) override;
void onManager() override;
void onConnect(const toolkit::SockException &ex) override;
void setClient(mk_tcp_client client);