frankvHoof93 / TikTokLiveSharp

Port of TikTok live library for C#
https://vanhoof.dev
Other
140 stars 28 forks source link

[BUG] 'System.IO.EndOfStreamException' in protobuf-net.dll #23

Closed ghostmaster75 closed 8 months ago

ghostmaster75 commented 1 year ago

Describe the bug After a few seconds of the client connecting and receiving the first messages, it consistently throws the 'System.IO.EndOfStreamException' exception in protobuf-net.dll, but only when the calling program is C# UWP.

To Reproduce Steps to reproduce the behavior:

  1. In visual studio 2022 create a new C# UWP project
  2. call the Tittok library
  3. After few second or less you got the error

Expected behavior Library not work like the console C# program

Stacktrace

Eccezione generata: 'System.IO.EndOfStreamException' in protobuf-net.dll
[ERROR] System.IO.EndOfStreamException: Attempted to read past the end of the stream.
   at ProtoBuf.ProtoReader.State.ThrowEoF() in /_/src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 809
   at ProtoBuf.ProtoReader.StreamProtoReader.ImplReadBytes(State& state, Span1 target) in //src/protobuf-net.Core/ProtoReader.Stream.cs:line 252
   at ProtoBuf.ProtoReader.State.AppendBytesImpl[TStorage](TStorage value, IMemoryConverter`2 converter) in //src/protobuf-net.Core/ProtoReader.State.ReadMethods.cs:line 394
   at proto_10(State& , WebcastWebsocketMessage )
   at ProtoBuf.ProtoReader.State.ReadAsRoot[T](T value, ISerializer1 serializer)
   at ProtoBuf.ProtoReader.State.DeserializeRoot[T](T value, ISerializer1 serializer)
   at ProtoBuf.Serializer.Deserialize[T](Stream source)
   at TikTokLiveSharp.Client.TikTokBaseClient.WebSocketLoop()
mozerg commented 12 months ago

I have the same issue

frankvHoof93 commented 11 months ago

Underlying issue in Protobuf. Being discussed here: https://github.com/protobuf-net/protobuf-net/issues/1048

frankvHoof93 commented 8 months ago

Resolved in V1.0.0