TCP listener seems to be working really well :)

This commit is contained in:
soypat
2025-06-11 19:38:19 -03:00
parent 63cf2e2669
commit 1fcdd9a7b3
4 changed files with 63 additions and 14 deletions
+3
View File
@@ -65,6 +65,7 @@ func main() {
lastHit := time.Now().Add(-standbyDuration)
var cap pcap.PacketBreakdown
var conn *tcp.Conn
accepted := 0
for {
nread, err := tap.Read(buf[:])
if err != nil {
@@ -90,6 +91,8 @@ func main() {
if err != nil {
lg.Error("tryaccept", slog.String("err", err.Error()))
}
accepted++
hdr.Reset(nil)
lg.Info("ACCEPT!")
}
if conn != nil {