去除手动设置codec的逻辑

This commit is contained in:
lwch
2023-02-20 15:04:50 +08:00
parent 8b19533bd4
commit 583ec2e6dd
2 changed files with 0 additions and 4 deletions
-2
View File
@@ -11,7 +11,6 @@ import (
"github.com/lwch/logging"
"github.com/lwch/natpass/code/client/global"
"github.com/lwch/natpass/code/network"
"github.com/lwch/natpass/code/network/encoding/proto"
"github.com/lwch/natpass/code/utils"
"github.com/lwch/runtime"
)
@@ -82,7 +81,6 @@ func (conn *Conn) connect() error {
return err
}
cn := network.NewConn(dial)
cn.SetCodec(proto.New())
err = writeHandshake(cn, conn.cfg)
if err != nil {
logging.Error("write handshake: %v", err)
-2
View File
@@ -8,7 +8,6 @@ import (
"github.com/lwch/logging"
"github.com/lwch/natpass/code/network"
"github.com/lwch/natpass/code/network/encoding/proto"
"github.com/lwch/natpass/code/server/global"
)
@@ -50,7 +49,6 @@ func New(cfg *global.Configure) *Handler {
// Handle main loop
func (h *Handler) Handle(conn net.Conn) {
c := network.NewConn(conn)
c.SetCodec(proto.New())
var id string
defer func() {
if len(id) > 0 {