开发者

How to make real-time connection Java and Flex?

I'm still new at Flex. I want to make a flex code that request data to server everytime. I use java as a server.

Actually, i have successfully generate a linked-list of data at server from asterisk cli command. like this :

Name/username              Host            Dyn Nat ACL Port     Status    
2005                       (Unspecified)    D   N      0        UNKNOWN   
开发者_JS百科2004                       (Unspecified)    D   N      0        UNKNOWN   
2003                       (Unspecified)    D   N      0        UNKNOWN   
2002                       (Unspecified)    D   N      0        UNKNOWN   
2001/2001                  127.0.0.1        D   N      19134    OK (106 ms)
2000                       (Unspecified)    D   N      0        UNKNOWN   
6 sip peers [1 online , 5 offline]

I want to show this in flex user interface with real-time connection, what should I do?

i will appreciate your advice.

thanks in advance


To delivery data to a Flex application in real time, you'll need a server side piece that supports push functionality. BlazeDS and GraniteDS do so using the Long Polling approach. LiveCycle and WebORB support RTMP to do so.

Here is some documentation for LiveCycle explaining more details.

Here is a Blog post about doing this w/ BlazeDS.


It is a general question so here is a general answer.

It sounds like you're asking about messages that come from the server and go to the client. The idea is that the server should update clients when data changes on the server.

The truth is that this kind of two-way communication isn't possible with HTTP (and Flex talks to Java over HTTP) but can be simulated (via polling or comet).

The two solutions I would recommend looking into are...

  • Implement your own polling solution using a Flex timer.
  • Look into standard polling/comet solutions such as BlazeDS or GraniteDS
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜