Search code examples
javaserverred5

Red5 client stream disconnect event fired after reconnection


I am using Red5 1.0.6 version

If a user connection is disconnected due to internet disconnection, disconnect function is called after the client is reconnected.

public void disconnect(IConnection conn, IScope scope) {
   System.out.println("disconnected");
}

How to configure Red5 such that disconnect function is called immediately after client is disconnect?

I have searched but I didn't find any answer, Is it possible to get the Stream Publish stop event?

Even streamBroadcastClose function is called after reconnection of the client which is not immediately after disconnection.

How to get streamBroadcastClose event immediately after client disconnection due to internet issues?


Solution

  • The disconnection and re-connection affect two different sockets, there is no sharing there so one should not cause the other. A disconnection may be "caught" in more than one place in the server and it should be handled as appropriate to that section. The server will attempt to clean up and if a stream is publishing, you should get an unpublish event. I would suggest turning up the log levels in some areas to get a better insight as to what is happening here, also in your Application, make sure that overridden Red5 methods are calling super.