Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IlcDisableReflection = Connection Error #138

Open
JackHarckness opened this issue Apr 23, 2024 · 2 comments
Open

IlcDisableReflection = Connection Error #138

JackHarckness opened this issue Apr 23, 2024 · 2 comments

Comments

@JackHarckness
Copy link

JackHarckness commented Apr 23, 2024

When compiling with MSBuild attribute <IlcDisableReflection>true</IlcDisableReflection>, RtspClient cannot connect to a stream. Otherwise it works great. I'm attaching a relevant portion of the stack trace but you know, it is very much crippled since IlcDisableReflection is true.

RtspClientSharp's version: 1.3.3

Stack trace
Unhandled Exception: MT140699988240528: Connection error
 ---> MT140699988350928: End of rtsp stream
   at RtspClientSharp.Rtsp.RtspTransportClient.<ReadUntilEndOfHeadersAsync>d__16.MoveNext() + 0xfd
--- End of stack trace from previous location ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0xb2
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task, ConfigureAwaitOptions) + 0x4b
   at RtspClientSharp.Rtsp.RtspTransportClient.<GetResponseAsync>d__15.MoveNext() + 0xda
--- End of stack trace from previous location ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0xb2
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task, ConfigureAwaitOptions) + 0x4b
   at RtspClientSharp.Rtsp.RtspTransportClient.<ExecuteRequest>d__9.MoveNext() + 0x20c
--- End of stack trace from previous location ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0xb2
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task, ConfigureAwaitOptions) + 0x4b
   at RtspClientSharp.Rtsp.RtspClientInternal.<ConnectAsync>d__18.MoveNext() + 0x21f
--- End of stack trace from previous location ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0xb2
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task, ConfigureAwaitOptions) + 0x4b
   at RtspClientSharp.RtspClient.<>c__DisplayClass13_0.<<ConnectAsync>b__0>d.MoveNext() + 0x479
   Exception_EndOfInnerExceptionStack
   at RtspClientSharp.RtspClient.<>c__DisplayClass13_0.<<ConnectAsync>b__0>d.MoveNext() + 0x6c5
--- End of stack trace from previous location ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0xb2
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task, ConfigureAwaitOptions) + 0x4b
   at RtspClientSharp.RtspClient.<ConnectAsync>d__13.MoveNext() + 0x127

To Reproduce
If you want a repro, create a console application, add <IlcDisableReflection>true</IlcDisableReflection> to your .csproj file, make an async call to RtspClientSharp.ConnectAsync. Compile it then to native code (<PublishAot>true</PublishAot> and dotnet publish on .NET 8.0+ will do the trick) and run. Otherwise you won't be able to see this error.

@hez2010
Copy link

hez2010 commented May 13, 2024

IlcDisableReflection is not supported and it can cause many components not working as expected.

@JackHarckness
Copy link
Author

@hez2010 why do you think the reflection use is required within this library? Note that type checks like

if (e is RawH264IFrame intraFrame)
{
    //...
}

are still allowed in reflection-free mode. I would suggest a minor research and refactoring that will find and remove any reflection use. This can also lead to a minor performance increase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants