0

I am developing a online game using red5 and flex. using RTMP connection. I used only netConnection.call. my issue is the red5 calls are not coming synchronized manor. some calls are coming to client suddenly some calls are taking time. I want to make this calls reach to client side in order. please help me any one...

2 Answers2

0

Red5 offers two application adapters which support synchronized and multithreaded access. To use them, simply extend org.red5.server.adapter.ApplicationAdapter for sync or org.red5.server.adapter.MultiThreadedApplicationAdapter in your application.

Paul Gregoire
  • 9,715
  • 11
  • 67
  • 131
0

Followings are my opinions, I'm sure there are far better ways to do this.

  1. Write a class that is responsible from NetConnection.call execution. in this class, make sure that no call is made before previous one is completed. It ensures the order, but slows execution.
  2. Write a class such that: There should be a data structure, maybe an array in its simplest form. Array contains objects that holds call order, callback function and result returned from server. When you call a method, add those calls into the array in calling order. When you receive a result from server, check the array. if previous calls are not returned yet, store them in array. If there are no previous calls pending, call your callback function any functions "called later but finished earlier that this" and remove that item from your array.

But, (there is always a but in red5), if your application needs some result in order, maybe you should consider your architecture. Most of the time, a carefully thought event handling mechanism removes the need or ordered results.

Kadir San
  • 78
  • 1
  • 7