Index writes the list of file information to the connected peer device
(ctx context.Context, idx *Index)
| 316 | |
| 317 | // Index writes the list of file information to the connected peer device |
| 318 | func (c *rawConnection) Index(ctx context.Context, idx *Index) error { |
| 319 | select { |
| 320 | case <-c.closed: |
| 321 | return ErrClosed |
| 322 | case <-ctx.Done(): |
| 323 | return ctx.Err() |
| 324 | default: |
| 325 | } |
| 326 | c.idxMut.Lock() |
| 327 | c.send(ctx, idx.toWire(), nil) |
| 328 | c.idxMut.Unlock() |
| 329 | return nil |
| 330 | } |
| 331 | |
| 332 | // IndexUpdate writes the list of file information to the connected peer device as an update |
| 333 | func (c *rawConnection) IndexUpdate(ctx context.Context, idxUp *IndexUpdate) error { |