equal
deleted
inserted
replaced
228 } |
228 } |
229 |
229 |
230 func (cl *Client) Close() { |
230 func (cl *Client) Close() { |
231 // Shuts down the receivers: |
231 // Shuts down the receivers: |
232 cl.setStatus(StatusShutdown) |
232 cl.setStatus(StatusShutdown) |
|
233 |
233 // Shuts down the senders: |
234 // Shuts down the senders: |
234 close(cl.Send) |
235 select { |
|
236 case cl.Send <- &Iq{}: |
|
237 close(cl.Send) |
|
238 default: |
|
239 } |
235 } |
240 } |
236 |
241 |
237 // If there's a buffered error in the channel, return it. Otherwise, |
242 // If there's a buffered error in the channel, return it. Otherwise, |
238 // return what was passed to us. The idea is that the error in the |
243 // return what was passed to us. The idea is that the error in the |
239 // channel probably preceded (and caused) the one that's passed as an |
244 // channel probably preceded (and caused) the one that's passed as an |