Closed fcerini closed 4 years ago
OK, i guess i will have to capture the sip traffic from C with pcap and forward the packets to GO somehow... Maybe UDP?
It sounds like the issue may be processing speed in your handler, not the read layer. Packets are likely being dropped while your handler is doing things to each packet.
Things you can try: 1) Dumping the packets into a buffered channel 2) Using multiple readers to process an unbuffered channel 3) Buffer into a file system queue and process in batches
You are right, my channel is not buffered...
Hi, Im trying to process SIP traffic. The problem is that when the time difference between packets is less than 1 millisecond I lost the second packet. There are not much packets per second, but often there are several packets almost at the same time. EXAMPLE 2020-01-23 15:18:37.242669874 SIP/2.0 200 OK From: "1003"sip:1003@172.24.131.236:5060;tag=417857592 ...
2020-01-23 15:18:37.242701932 LOST REGISTER sip:172.24.131.236:5060 SIP/2.0 ...
This is part of my code: ` // pcap
`
I also tried afpacket with similar results...
` // afpacket afpacketHandle, err := newAfpacketHandle(iface, szFrame, szBlock, numBlocks, addVLAN, pcap.BlockForever) ...... source := gopacket.ZeroCopyPacketDataSource(afpacketHandle) defer afpacketHandle.Close()
`
Thanks in advance Best Regards