This commit is contained in:
crusader 2017-12-01 21:02:18 +09:00
parent abb270181b
commit 933fb0d87a
2 changed files with 4 additions and 5 deletions

View File

@ -1,6 +1,7 @@
package client package client
import ( import (
"fmt"
"io" "io"
"net" "net"
"net/http" "net/http"
@ -169,6 +170,9 @@ func NewSocket(sb SocketBuilder, parentContext cuc.Context) (Socket, error) {
d.Jar = sb.GetRequestCookie() d.Jar = sb.GetRequestCookie()
url := sb.GetURL() url := sb.GetURL()
if "" == url {
return nil, fmt.Errorf("Client Socket: URL of server must be specified")
}
reqHeader := sb.GetRequestHeader() reqHeader := sb.GetRequestHeader()
conn, res, err := d.Dial(url, reqHeader) conn, res, err := d.Dial(url, reqHeader)

View File

@ -7,7 +7,6 @@ import (
"net/url" "net/url"
"time" "time"
"git.loafle.net/commons_go/logging"
cuc "git.loafle.net/commons_go/util/context" cuc "git.loafle.net/commons_go/util/context"
cwf "git.loafle.net/commons_go/websocket_fasthttp" cwf "git.loafle.net/commons_go/websocket_fasthttp"
) )
@ -84,10 +83,6 @@ func (sb *SocketBuilders) GetWriteBufferSize() int {
} }
func (sb *SocketBuilders) Validate() { func (sb *SocketBuilders) Validate() {
if "" == sb.URL {
logging.Logger().Panic("Client Socket: URL must be specified")
}
if 0 >= sb.HandshakeTimeout { if 0 >= sb.HandshakeTimeout {
sb.HandshakeTimeout = cwf.DefaultHandshakeTimeout sb.HandshakeTimeout = cwf.DefaultHandshakeTimeout
} }