本文整理匯總了Golang中github.com/aws/amazon-ecs-agent/agent/wsclient.ClientServer.Close方法的典型用法代碼示例。如果您正苦於以下問題:Golang ClientServer.Close方法的具體用法?Golang ClientServer.Close怎麽用?Golang ClientServer.Close使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/aws/amazon-ecs-agent/agent/wsclient.ClientServer
的用法示例。
在下文中一共展示了ClientServer.Close方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: newDisconnectionTimer
// newDisconnectionTimer creates a new time object, with a callback to
// disconnect from ACS on inactivity
func newDisconnectionTimer(client wsclient.ClientServer, _time ttime.Time, timeout time.Duration, jitter time.Duration) ttime.Timer {
timer := _time.AfterFunc(utils.AddJitter(timeout, jitter), func() {
seelog.Warn("ACS Connection hasn't had any activity for too long; closing connection")
closeErr := client.Close()
if closeErr != nil {
seelog.Warnf("Error disconnecting: %v", closeErr)
}
})
return timer
}