From 933fb0d87a6be3cbe237009676491a8582f0c5ef Mon Sep 17 00:00:00 2001 From: crusader Date: Fri, 1 Dec 2017 21:02:18 +0900 Subject: [PATCH] ing --- client/socket.go | 4 ++++ client/socket_builders.go | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/client/socket.go b/client/socket.go index 1bb14db..ffa52de 100644 --- a/client/socket.go +++ b/client/socket.go @@ -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) diff --git a/client/socket_builders.go b/client/socket_builders.go index b10d7d0..58b245d 100644 --- a/client/socket_builders.go +++ b/client/socket_builders.go @@ -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 }