1 Reply Latest reply on Dec 26, 2007 8:20 AM by Newsgroup_User

    Sending messages to multiple clients

    Level 7
      In a p2p application, when a message is being sent to multiple clients,
      how does the instance performing the server function accomplish this?
      Specifically, if the message is a large amount of data broken into
      multiple packets, does it send all packets to client 1, then all packets
      to client 2, etc? Or does it send packet 1 to all clients, then packet 2
      to all clients, etc?
        • 1. Re: Sending messages to multiple clients
          Level 7
          Hi Dave,
          As usual, an interesting question..
          For this one, you have to have the source code to the Xtra to know exactly
          how it handles socket communication.
          For tcp sockets in general, it's the system that handles i/o, and each
          socket works independently.
          So, long as the app (the xtra) makes sure that data are copied to the
          socket's buffer soon as the system informs the app that it can send more
          data, then you have optimal performance - at least for the type of sockets
          the muXtra uses.

          As for your question, I'd say neither.
          When you send a message, it is converted to binary data and stored in the
          object's (not socket's) send buffer.
          Soon as all data are sent, and long as more messages exist in the sendque,
          then the next message is copied to the send buffer.
          So, if you send 2 messages to two users, it is possible that both messages
          are delivered to one of them, while the other is still receiving the first.

          "Dave C" <no@no.com> wrote in message
          news:fktrnq$cvh$1@forums.macromedia.com...
          > In a p2p application, when a message is being sent to multiple clients,
          > how does the instance performing the server function accomplish this?
          > Specifically, if the message is a large amount of data broken into
          > multiple packets, does it send all packets to client 1, then all packets
          > to client 2, etc? Or does it send packet 1 to all clients, then packet 2
          > to all clients, etc?