Commit 55a91868 authored by AlexStocks's avatar AlexStocks

change remark

parent b07130c1
...@@ -146,11 +146,7 @@ func NewWSClient(connNum int, connInterval time.Duration, serverAddr string) *Cl ...@@ -146,11 +146,7 @@ func NewWSClient(connNum int, connInterval time.Duration, serverAddr string) *Cl
// @cert is client certificate file. it can be emtpy. // @cert is client certificate file. it can be emtpy.
// @privateKey is client private key(contains its public key). it can be empty. // @privateKey is client private key(contains its public key). it can be empty.
// @caCert is the root certificate file to verify the legitimacy of server // @caCert is the root certificate file to verify the legitimacy of server
func NewWSSClient( func NewWSSClient(connNum int, connInterval time.Duration, serverAddr string, cert string) *Client {
connNum int,
connInterval time.Duration,
serverAddr string,
cert string) *Client {
if connNum <= 0 { if connNum <= 0 {
connNum = 1 connNum = 1
......
...@@ -62,6 +62,7 @@ type Server struct { ...@@ -62,6 +62,7 @@ type Server struct {
} }
// NewTCServer builds a tcp server. // NewTCServer builds a tcp server.
// @addr server listen address.
func NewTCPServer(addr string) *Server { func NewTCPServer(addr string) *Server {
return &Server{ return &Server{
typ: TCP_SERVER, typ: TCP_SERVER,
...@@ -71,7 +72,7 @@ func NewTCPServer(addr string) *Server { ...@@ -71,7 +72,7 @@ func NewTCPServer(addr string) *Server {
} }
// NewUDPServer builds a unconnected udp server. // NewUDPServer builds a unconnected udp server.
// @path: websocket request url path // @addr server listen address.
func NewUDPPServer(addr string) *Server { func NewUDPPServer(addr string) *Server {
return &Server{ return &Server{
typ: UDP_SERVER, typ: UDP_SERVER,
...@@ -80,31 +81,29 @@ func NewUDPPServer(addr string) *Server { ...@@ -80,31 +81,29 @@ func NewUDPPServer(addr string) *Server {
} }
} }
// NewWSSServer builds a websocket server. // NewWSServer builds a websocket server.
// @addr server listen address.
// @path: websocket request url path // @path: websocket request url path
func NewWSServer(path string) *Server { func NewWSServer(addr string, path string) *Server {
return &Server{ return &Server{
typ: WS_SERVER, typ: WS_SERVER,
done: make(chan gxsync.Empty), done: make(chan gxsync.Empty),
addr: addr,
path: path, path: path,
} }
} }
// NewWSSServer builds a secure websocket server. // NewWSSServer builds a secure websocket server.
// @addr server listen address.
// @path: websocket request url path // @path: websocket request url path
// @cert: server certificate file // @cert: server certificate file
// @privateKey: server private key(contains its public key) // @privateKey: server private key(contains its public key)
// @caCert: root certificate file. to verify the legitimacy of client. it can be nil. // @caCert: root certificate file. to verify the legitimacy of client. it can be nil.
func NewWSSServer( func NewWSSServer(addr, path, cert, privateKey, caCert string) *Server {
path string,
cert string,
privateKey string,
caCert string,
) *Server {
return &Server{ return &Server{
typ: WSS_SERVER, typ: WSS_SERVER,
done: make(chan gxsync.Empty), done: make(chan gxsync.Empty),
addr: addr,
path: path, path: path,
cert: cert, cert: cert,
privateKey: privateKey, privateKey: privateKey,
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
package getty package getty
const ( const (
Version = "0.8.01" Version = "0.8.1"
DATE = "2018/03/08" DATE = "2018/03/08"
GETTY_MAJOR = 0 GETTY_MAJOR = 0
GETTY_MINOR = 8 GETTY_MINOR = 8
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment