1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-20 10:20:25 +08:00

优化封装

This commit is contained in:
fumiama
2022-01-01 14:57:57 +08:00
parent a904ec5973
commit 331e57d221
2 changed files with 8 additions and 5 deletions

View File

@@ -92,7 +92,14 @@ func (m *Me) MTU() uint16 {
return m.mtu
}
func (m *Me) Close() error {
m.nic.Down()
return m.nic.Close()
}
func (m *Me) ListenFromNIC() {
m.nic.Up()
// 双缓冲区
buf := make([]byte, m.MTU()+68) // 增加报头长度与 TEA 冗余
buf2 := make([]byte, m.MTU()+68) // 增加报头长度与 TEA 冗余