You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

43 lines
680 B

package tcp
import (
"github.com/ginuerzh/gost"
)
type tcpNode struct {
options *tcpNodeOptions
client *nodeClient
server *nodeServer
}
// NewNode creates a tcpNode with options
func NewNode(opts ...gost.Option) gost.Node {
node := &tcpNode{
options: new(tcpNodeOptions),
}
for _, opt := range opts {
opt(node.options)
}
return node
}
func (node *tcpNode) Init(opts ...gost.Option) error {
for _, opt := range opts {
opt(node.options)
}
return nil
}
func (node *tcpNode) Client() gost.Client {
return node.client
}
func (node *tcpNode) Server() gost.Server {
return node.server
}
func (node *tcpNode) Options() gost.Options {
return node.options
}