MCPcopy Create free account
hub / github.com/google/gapid / wait

Method wait

core/java/jdwp/jdwp.go:166–189  ·  view source on GitHub ↗

wait blocks until the penging response is received, filling out with the response data.

(out interface{})

Source from the content-addressed store, hash-verified

164// wait blocks until the penging response is received, filling out with the
165// response data.
166func (p *pending) wait(out interface{}) error {
167 select {
168 case reply := <-p.p:
169 if reply.err != ErrNone {
170 dbg("<%v> recv err: %+v", p.id, reply.err)
171 return reply.err
172 }
173 if out == nil {
174 return nil
175 }
176 r := bytes.NewReader(reply.data)
177 d := endian.Reader(r, device.BigEndian)
178 if err := p.c.decode(d, reflect.ValueOf(out)); err != nil {
179 return err
180 }
181 dbg("<%v> recv: %+v", p.id, out)
182 if offset, _ := r.Seek(0, 1); offset != int64(len(reply.data)) {
183 panic(fmt.Errorf("Only %d/%d bytes read from reply packet", offset, len(reply.data)))
184 }
185 return nil
186 case <-time.After(time.Second * 120):
187 return fmt.Errorf("timeout")
188 }
189}
190
191func (c *Connection) newReplyHandler() (packetID, <-chan replyPacket) {
192 reply := make(chan replyPacket, 1)

Callers 1

getMethod · 0.45

Calls 6

SeekMethod · 0.80
AfterMethod · 0.80
dbgFunction · 0.70
NewReaderMethod · 0.65
ReaderMethod · 0.65
decodeMethod · 0.65

Tested by

no test coverage detected