()
| 29 | } |
| 30 | |
| 31 | func (b *Bsteam) Connect() error { |
| 32 | b.Log.Info("Connecting") |
| 33 | b.c = steam.NewClient() |
| 34 | go b.handleEvents() |
| 35 | go b.c.Connect() |
| 36 | select { |
| 37 | case <-b.connected: |
| 38 | b.Log.Info("Connection succeeded") |
| 39 | case <-time.After(time.Second * 30): |
| 40 | return fmt.Errorf("connection timed out") |
| 41 | } |
| 42 | return nil |
| 43 | } |
| 44 | |
| 45 | func (b *Bsteam) Disconnect() error { |
| 46 | b.c.Disconnect() |
nothing calls this directly
no test coverage detected