ing
This commit is contained in:
parent
abb270181b
commit
933fb0d87a
|
@ -1,6 +1,7 @@
|
|||
package client
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
|
@ -169,6 +170,9 @@ func NewSocket(sb SocketBuilder, parentContext cuc.Context) (Socket, error) {
|
|||
d.Jar = sb.GetRequestCookie()
|
||||
|
||||
url := sb.GetURL()
|
||||
if "" == url {
|
||||
return nil, fmt.Errorf("Client Socket: URL of server must be specified")
|
||||
}
|
||||
reqHeader := sb.GetRequestHeader()
|
||||
|
||||
conn, res, err := d.Dial(url, reqHeader)
|
||||
|
|
|
@ -7,7 +7,6 @@ import (
|
|||
"net/url"
|
||||
"time"
|
||||
|
||||
"git.loafle.net/commons_go/logging"
|
||||
cuc "git.loafle.net/commons_go/util/context"
|
||||
cwf "git.loafle.net/commons_go/websocket_fasthttp"
|
||||
)
|
||||
|
@ -84,10 +83,6 @@ func (sb *SocketBuilders) GetWriteBufferSize() int {
|
|||
}
|
||||
|
||||
func (sb *SocketBuilders) Validate() {
|
||||
if "" == sb.URL {
|
||||
logging.Logger().Panic("Client Socket: URL must be specified")
|
||||
}
|
||||
|
||||
if 0 >= sb.HandshakeTimeout {
|
||||
sb.HandshakeTimeout = cwf.DefaultHandshakeTimeout
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user