This commit is contained in:
esrrhs 2018-12-19 14:42:53 +08:00
parent 2beaecc533
commit 27cf425b48
3 changed files with 4 additions and 4 deletions

View File

@ -101,7 +101,7 @@ func (p *Client) Run() {
go p.Accept() go p.Accept()
recv := make(chan *Packet, 1000) recv := make(chan *Packet, 10000)
go recvICMP(*p.conn, recv) go recvICMP(*p.conn, recv)
interval := time.NewTicker(time.Second) interval := time.NewTicker(time.Second)

View File

@ -185,12 +185,12 @@ func recvICMP(conn icmp.PacketConn, recv chan<- *Packet) {
my.Unmarshal(bytes[4:n]) my.Unmarshal(bytes[4:n])
if my.TYPE != (uint32)(DATA) || my.ENDTYPE != (uint32)(DATA) { if my.TYPE != (uint32)(DATA) || my.ENDTYPE != (uint32)(DATA) {
fmt.Printf("processPacket diff type %s %d %d \n", my.ID, my.TYPE, my.ENDTYPE) //fmt.Printf("processPacket diff type %s %d %d \n", my.ID, my.TYPE, my.ENDTYPE)
continue continue
} }
if my.Data == nil { if my.Data == nil {
fmt.Printf("processPacket data nil %s\n", my.ID) //fmt.Printf("processPacket data nil %s\n", my.ID)
return return
} }

View File

@ -41,7 +41,7 @@ func (p *Server) Run() {
p.localConnMap = make(map[string]*ServerConn) p.localConnMap = make(map[string]*ServerConn)
recv := make(chan *Packet, 1000) recv := make(chan *Packet, 10000)
go recvICMP(*p.conn, recv) go recvICMP(*p.conn, recv)
interval := time.NewTicker(time.Second) interval := time.NewTicker(time.Second)