-1

We are attempting to provide a service where two customer devices would need to talk to each other through our servers. Each device may come online or go offline at anytime. When they are both online, they can exchange information with each other through our server.

I am inclined towards a Flex/PHP solution, however following scenarios baffle me:

1) when client device-A attempts to get some information from client device-B through my server, the incoming request from device-A will be a Flex AMF service request. How do I relay that flex request to device-B? Relaying is preferred if possible. Else, should I terminate the request from device-A on my server and originate a request to device-B?

2) when device-B responds with data to the request from device-A (discussed in (1) above), can I relay that data to device-A directly or do I need to terminate the response and send a new message to device-A with the data from device-B?

May be I am completely off-track or Flex/AMF/PHP is not the best solution. Let me know what you think.

Thanks

Vishal
  • 5
  • 1
  • so where is the question that falls within the bounds of the faq (http://stackoverflow.com/faq) ? –  Jul 30 '12 at 06:09
  • i thought the questions were pretty clearly spelled out in the 2 scenarios that i listed. i am not sure how much more specific i can be considering the stage of the project that i am in. or are you suggesting that stackoverflow is not for architectural discussions? – Vishal Jul 30 '12 at 08:04

1 Answers1

0

I have a similar setup, even though my server is a BlazeDS Java Server and not PHP. I solved this problem by using Amf Destinations. If you are familiar with JMS, this is relatively similar. I have one public destination for inter-client-communication and one private destination for each client. When one client wants to know something from any other client it sends a message to the public destination and all clients get the request. In the request the client passes the id of its private destination. If one client gets the requests and notices that he should respond, he simply sends a response-message to the private destination that was mentioned in the request.

I hope this is what you were asking for. You could alternately send the response to the public desination. The side-effect however would be that the response would be sent to all the other clients too and this would only increase network traffic and make the clients have to filter out stuff that is not sent to them.

Christofer Dutz
  • 2,305
  • 1
  • 23
  • 34
  • While I could not use your suggestions directly, I got some pointers that I think will help me find a way out. Thanks. – Vishal Aug 01 '12 at 20:30