NetCoreServer icon indicating copy to clipboard operation
NetCoreServer copied to clipboard

Multicast UDP client sample code : receiving same data multiple time

Open vikaschamp opened this issue 3 years ago • 1 comments

Hi ,

I am trying to use netCoreserver library to receive the high frequency NSE TBT multicast data . I have use multicast udp client sample code . But it is receiving same packet multiple time and giving exception stack over flow .

.................................................. Stack overflow. at System.Text.OSEncoding.WideCharToMultiByte(Int32, Char*, Int32, Byte*, Int32) at System.Text.OSEncoder.GetBytes(Char*, Int32, Byte*, Int32, Boolean) at System.Text.Encoder.GetBytes(System.ReadOnlySpan1<Char>, System.Span1<Byte>, Boolean) at System.IO.StreamWriter.Flush(Boolean, Boolean) at System.IO.StreamWriter.WriteLine(System.String) at System.IO.TextWriter+SyncTextWriter.WriteLine(System.String) at System.Console.WriteLine(System.String) at NSEFO_TBT.Controller.MultiCastUDPReader.OnReceived(System.Net.EndPoint, Byte[], Int64, Int64) at NetCoreServer.UdpClient.ProcessReceiveFrom(System.Net.Sockets.SocketAsyncEventArgs) at NetCoreServer.UdpClient.TryReceive() at NSEFO_TBT.Controller.MultiCastUDPReader.OnReceived(System.Net.EndPoint, Byte[], Int64, Int64) at NetCoreServer.UdpClient.ProcessReceiveFrom(System.Net.Sockets.SocketAsyncEventArgs) at NetCoreServer.UdpClient.TryReceive() at NSEFO_TBT.Controller.MultiCastUDPReader.OnReceived(System.Net.EndPoint, Byte[], Int64, Int64) at NetCoreServer.UdpClient.ProcessReceiveFrom(System.Net.Sockets.SocketAsyncEventArgs) at NetCoreServer.UdpClient.TryReceive() ....................

Please suggest what am i doing wrong here .

vikaschamp avatar Jun 28 '22 08:06 vikaschamp

Stack over flow error is solved it is calling from the OnReceived . It was going in infinte recursion loop so stack over flow error is throwing . But the same data receiving multiple time is still there .

vikaschamp avatar Jun 28 '22 09:06 vikaschamp