Function
waitForClientToDisconnect
(logger logging.Logger, s *yamux.Session, t time.Duration)
Source from the content-addressed store, hash-verified
| 158 | } |
| 159 | |
| 160 | func waitForClientToDisconnect(logger logging.Logger, s *yamux.Session, t time.Duration) { |
| 161 | timeout := time.After(t) |
| 162 | for { |
| 163 | select { |
| 164 | case <-time.After(50 * time.Millisecond): |
| 165 | case <-timeout: |
| 166 | logger.Printf("Timeout expired but %d streams still open, shutting down server...", s.NumStreams()) |
| 167 | return |
| 168 | } |
| 169 | streams := s.NumStreams() |
| 170 | if streams <= 0 { |
| 171 | return |
| 172 | } |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | func (i *ipcImpl) Close() error { |
| 177 | return i.teardown() |
Tested by
no test coverage detected