edited January 2011 in Photon Server
What is the purpose of the channel parameter in Peer.PublishEvent? Also, what is the different between Peer.Publish and MessageChannel.Publish?


  • the channel id is for the reliable transport protocol that we use for UDP. all messages sent to the client on the same channel are guaranteed to arrive in the same order they were sent. if you send messages on two different channels they can arrive in a different order.

    events sent with peer.publish are sent to the client.

    messagechannel<T>.publish accepts any message of type T.
    subscribers receive this message usually through a PoolFiber.
    this is just a publish/subscribe pattern that deals with multi-threading and has nothing to do with the channel id that you asked about.