Reputation: 31483
What is the best way to implement async json socket communication between Flex client and custom server?
Is there a library that can listen to socket and fire event when complete json message/object is raceived?
EDIT: I know that I can use Socket and listen to SOCKET_DATA event, but that triggers event whenever new data is received, while I need to be notified only when (complete) jton object is received.
I was hoping for something more automatic :)
Upvotes: 2
Views: 1765
Reputation: 16085
You'll need to use the Socket class for that. The socketData event is triggered when new data is received. There are also events that get fired when the connection opens and closes or when you have an io or security error.
If you're using AIR, you can also use the SocketMonitor to monitor your server endpoint.
Upvotes: 1