TarsCloud / Tars

Tars is a high-performance RPC framework based on name service and Tars protocol, also integrated administration platform, and implemented hosting-service via flexible schedule.
BSD 3-Clause "New" or "Revised" License
9.8k stars 2.08k forks source link

TARSCPP服务怎样主动断开客户端 #873

Open NewStartEx opened 2 years ago

NewStartEx commented 2 years ago

TARS服务会在与客户端停止数据交互后超时自动断开。不过在某些情况下(例如发现被恶意攻击)最好主动断开与客户端的连接。这个在编写的服务里怎样实现呢?

ruanshudong commented 2 years ago

拿到current, 用current->close() 去关闭连接