test(gateway): measure qualification wire capacity
Verify Data Plane / gateway (push) Successful in 4m46s
Verify Data Plane / gateway (push) Successful in 4m46s
This commit is contained in:
@@ -940,12 +940,20 @@ func (c *independentGatewayClient) ReceiveFrame(ctx context.Context) (Frame, err
|
||||
}
|
||||
|
||||
func (c *independentGatewayClient) ReceiveMedia(ctx context.Context) ([]byte, error) {
|
||||
return c.receiveMedia(ctx, nil)
|
||||
}
|
||||
|
||||
func (c *independentGatewayClient) receiveMedia(ctx context.Context, observe func(time.Time, int)) ([]byte, error) {
|
||||
for {
|
||||
data, err := c.connection.ReceiveDatagram(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
payload, complete, err := c.media.Add(data, time.Now())
|
||||
receivedAt := time.Now()
|
||||
if observe != nil {
|
||||
observe(receivedAt, len(data))
|
||||
}
|
||||
payload, complete, err := c.media.Add(data, receivedAt)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user