IndexUpdate writes the list of file information to the connected peer device as an update
(ctx context.Context, idxUp *IndexUpdate)
| 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 { |
| 334 | select { |
| 335 | case <-c.closed: |
| 336 | return ErrClosed |
| 337 | case <-ctx.Done(): |
| 338 | return ctx.Err() |
| 339 | default: |
| 340 | } |
| 341 | c.idxMut.Lock() |
| 342 | c.send(ctx, idxUp.toWire(), nil) |
| 343 | c.idxMut.Unlock() |
| 344 | return nil |
| 345 | } |
| 346 | |
| 347 | // Request returns the bytes for the specified block after fetching them from the connected peer. |
| 348 | func (c *rawConnection) Request(ctx context.Context, req *Request) ([]byte, error) { |