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

rtmpNetworkStream.BeginRead not finishing #16

Open
GoogleCodeExporter opened this issue Feb 2, 2016 · 0 comments
Open

rtmpNetworkStream.BeginRead not finishing #16

GoogleCodeExporter opened this issue Feb 2, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

I'm using the latest version from the repository (1.0.0.17) on Windows 2008 
server.

Since my website receives relatively good amount of traffic, every day a 
"crazy" client connects which opens up over a thousand concurrent connections. 
Here's what happens:
1) the client establishes a new connection
2) it sends a normal message such as Idle, however the body of the message is 
empty
3) the RtmpServerConnection resets the stream pointer back to the beginning and 
issues another _rtmpNetworkStream.BeginRead expecting that next time all of the 
data will be read
4) the async call to BeginReadCallbackProcessing never happens
5) the client opens a new connection and sends the next message as if nothing 
is wrong

My guess is that the client is behind some sort of a proxy server such as 
Squid, which somehow interferes with the messages.

I have solved this by adding another wait job similar to the WaitForHandshake, 
which is scheduled to run when the RtmptProtocolDecoder.DecodeBuffer detects 
that not all the data was received. The DecodeBuffer also needed to be changed 
so that it now returns a boolean value indicating if all has been received, 
while the RtmpRequest is returned as an out parameter.

If the BeginReadCallbackProcessing method gets called, the job gets 
unscheduled. If not, the job fires and closes the connection - similar as the 
the WaitForHandshake does.

This fix however causes another problem: although the RtmpServerConnection gets 
closed, the RtmptConnection instance remains.

In the attachment you can find both of the files.

Original issue reported on code.google.com by nikola.d...@gmail.com on 25 Aug 2010 at 12:43

Attachments:

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

No branches or pull requests

1 participant