Skip to content

Commit 583ec2e

Browse files
committed
去除手动设置codec的逻辑
1 parent 8b19533 commit 583ec2e

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

code/client/conn/conn.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"github.com/lwch/logging"
1212
"github.com/lwch/natpass/code/client/global"
1313
"github.com/lwch/natpass/code/network"
14-
"github.com/lwch/natpass/code/network/encoding/proto"
1514
"github.com/lwch/natpass/code/utils"
1615
"github.com/lwch/runtime"
1716
)
@@ -82,7 +81,6 @@ func (conn *Conn) connect() error {
8281
return err
8382
}
8483
cn := network.NewConn(dial)
85-
cn.SetCodec(proto.New())
8684
err = writeHandshake(cn, conn.cfg)
8785
if err != nil {
8886
logging.Error("write handshake: %v", err)

code/server/handler/handler.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88

99
"github.com/lwch/logging"
1010
"github.com/lwch/natpass/code/network"
11-
"github.com/lwch/natpass/code/network/encoding/proto"
1211
"github.com/lwch/natpass/code/server/global"
1312
)
1413

@@ -50,7 +49,6 @@ func New(cfg *global.Configure) *Handler {
5049
// Handle main loop
5150
func (h *Handler) Handle(conn net.Conn) {
5251
c := network.NewConn(conn)
53-
c.SetCodec(proto.New())
5452
var id string
5553
defer func() {
5654
if len(id) > 0 {

0 commit comments

Comments
 (0)