Use reconnect timeout on client (#12)

This commit is contained in:
Serene Han 2016-02-17 19:53:11 -08:00
parent f205a0be59
commit 8a2e7a6041
3 changed files with 36 additions and 25 deletions

View file

@ -5,6 +5,7 @@ package main
import (
"bytes"
"errors"
"io/ioutil"
"log"
"net/http"
@ -66,6 +67,9 @@ func (bc *BrokerChannel) Negotiate(offer *webrtc.SessionDescription) (
}
defer resp.Body.Close()
log.Printf("BrokerChannel Response:\n%s\n\n", resp.Status)
if http.StatusOK != resp.StatusCode {
return nil, errors.New("no answer from broker.")
}
body, err := ioutil.ReadAll(resp.Body)
if nil != err {
return nil, err