Skip to content

Commit

Permalink
Changed dmsg.Transport default buffer sizes.
Browse files Browse the repository at this point in the history
  • Loading branch information
林志宇 committed Jun 10, 2019
1 parent 6933890 commit 785775a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/dmsg/frame.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ const (
// Type returns the transport type string.
Type = "dmsg"

hsTimeout = time.Second * 10
tpBufCap = math.MaxUint16
tpAckCap = math.MaxUint8
acceptChSize = 20
headerLen = 5 // fType(1 byte), chID(2 byte), payLen(2 byte)
hsTimeout = time.Second * 10
tpBufCap = math.MaxUint16
tpBufFrameCap = math.MaxUint8
tpAckCap = math.MaxUint8
acceptChSize = 20
headerLen = 5 // fType(1 byte), chID(2 byte), payLen(2 byte)
)

func isInitiatorID(tpID uint16) bool { return tpID%2 == 0 }
Expand Down
1 change: 1 addition & 0 deletions pkg/dmsg/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func NewTransport(conn net.Conn, log *logging.Logger, local, remote cipher.PubKe
remote: remote,
inCh: make(chan Frame),
ackBuf: make([]byte, 0, tpAckCap),
buf: make(net.Buffers, 0, tpBufFrameCap),
bufCh: make(chan struct{}, 1),
done: make(chan struct{}),
doneFunc: doneFunc,
Expand Down

0 comments on commit 785775a

Please sign in to comment.