()
| 158 | } |
| 159 | |
| 160 | func (s *Proxy) Start() error { |
| 161 | s.mu.Lock() |
| 162 | defer s.mu.Unlock() |
| 163 | if s.closed { |
| 164 | return ErrClosedProxy |
| 165 | } |
| 166 | if s.online { |
| 167 | return nil |
| 168 | } |
| 169 | s.online = true |
| 170 | s.router.Start() |
| 171 | if s.jodis != nil { |
| 172 | s.jodis.Start() |
| 173 | } |
| 174 | return nil |
| 175 | } |
| 176 | |
| 177 | func (s *Proxy) Close() error { |
| 178 | s.mu.Lock() |
no outgoing calls