Don't block socket reading

This commit is contained in:
Leonid Bugaev
2013-06-19 13:34:01 +06:00
parent cad13f4233
commit 6ba587e82e
+4 -2
View File
@@ -104,8 +104,10 @@ func (t *RAWTCPListener) readTCPPackets() {
new_buf := make([]byte, n)
copy(new_buf, buf[:n])
packet := NewTCPPacket(new_buf)
t.c_packets <- packet
go func(buf []byte) {
packet := NewTCPPacket(new_buf)
t.c_packets <- packet
}(new_buf)
}
}
}