mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-03 22:45:13 +08:00
新增对Rpc连接事件的监听
This commit is contained in:
@@ -26,6 +26,7 @@ type Client struct {
|
||||
pendingTimer *list.List
|
||||
callRpcTimeout time.Duration
|
||||
maxCheckCallRpcCount int
|
||||
TriggerRpcEvent
|
||||
}
|
||||
|
||||
func (client *Client) NewClientAgent(conn *network.TCPConn) network.Agent {
|
||||
@@ -259,6 +260,7 @@ func (client *Client) Run(){
|
||||
}
|
||||
}()
|
||||
|
||||
client.TriggerRpcEvent(true,client.GetId())
|
||||
for {
|
||||
bytes,err := client.conn.ReadMsg()
|
||||
if err != nil {
|
||||
@@ -314,6 +316,7 @@ func (client *Client) Run(){
|
||||
}
|
||||
|
||||
func (client *Client) OnClose(){
|
||||
client.TriggerRpcEvent(false,client.GetId())
|
||||
}
|
||||
|
||||
func (client *Client) IsConnected() bool {
|
||||
|
||||
Reference in New Issue
Block a user