ing
This commit is contained in:
parent
4e686edc48
commit
5378338700
|
@ -2,6 +2,7 @@ package client
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"path"
|
||||
|
||||
|
@ -19,10 +20,10 @@ func NewConnector(containerType occp.ContainerType, portNumber int) (*csswc.Conn
|
|||
u.Path = path.Join(u.Path, occc.HTTPEntry_Container)
|
||||
|
||||
connector := &csswc.Connectors{
|
||||
Name: containerType.String(),
|
||||
URL: u.String(),
|
||||
}
|
||||
|
||||
connector.Name = containerType.String()
|
||||
connector.ReconnectInterval = 5
|
||||
connector.ReconnectTryTime = 2
|
||||
connector.MaxMessageSize = 4096
|
||||
|
@ -32,6 +33,14 @@ func NewConnector(containerType occp.ContainerType, portNumber int) (*csswc.Conn
|
|||
connector.PingTimeout = 10
|
||||
connector.PingPeriod = 9
|
||||
|
||||
connector.RequestHeader = func() http.Header {
|
||||
header := make(map[string][]string)
|
||||
header[occc.HTTPRequestHeaderKey_Container_Method] = []string{occc.HTTPRequestHeaderValue_Container_Method_Connect}
|
||||
header[occp.HTTPRequestHeaderKey_Container_Type] = []string{containerType.String()}
|
||||
return header
|
||||
}
|
||||
connector.ResponseHandler = func(res *http.Response) {
|
||||
}
|
||||
connector.OnDisconnected = func(connector csc.Connector) {
|
||||
logging.Logger().Debugf("Client[%s] has been disconnected", connector.GetName())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user