ChannelIDs

Options
Sergiy
Sergiy
edited May 2012 in DotNet
Hi

I was searching forums for info about ChannelID but only found that opcustom can send operation through different ChannelID and the ChannelID 0 is the main channel. Perhaps i did overlook some info as i didn't look in old photon2 related topics.
So, here are questions just out of my mind:
1. What good is to send requests through channels with higher ID?
2. Will different channels operate independently from each other? For example: send info through channelid 1 and receive event through channelid 2 will process in parallel?
3. Is operationresponse from server sent through the same channelid that related operationrequest arrived?
4. How can server send event via specified channelid?
5. Can channelid be used in as3 client?

As i wrote, these questions are just out of my mind. It would be great if you explain more details about ChannelID purposes and usage

Thanks

Comments

  • dreamora
    Options
    Channel Id s are a 'channel priority' system.
    The lower the ID the more important it is. So if you have messages on channel id 0, 1, 2 and have limited bandwidth so you can't send everything then it will first be stuff on channel id 1 thats sent, then channel id 1 and the last thing sent will be channel id 2

    1. Its to send stuff with lower priority there in case the bandwidth is exceeded so the important stuff still is passed through.
    When you use udp then you would especially put unreliable position updates there.

    2. both works but there is no parallel. There is 1 message pipe in which it comes in one after the other.

    3. Can't answer that as all photon operations run on channel 0 by default as they are all 'connection existance' operations normally. Photon does not offer 'game mechanic operations' in its example applications, thats handled through events (as operations require server side modifications and all samples work with the out of the box server)

    4. the same way the client can do it through specifying it when the event is queued

    5. potentially but it wouldn't make much sense as Flash can only use TCP and if everything you send is reliable there is no 'lower priority discard'. With TCP the bandwidth overload needs to be tackled through stopping to send that much data, anything else will sooner or later result in a TCP hardware layer disconnect from the OS.
  • Sergiy
    Options
    Tnanks, dreamora,

    Everything is clear except p.4 - In opCustom method I can pass ChannelID as parameter. SendEvent method does not have such parameter, so how can i specify ChannelID? In Sendparameters structure?
  • Philip
    Options
    Yes you set it through the Sendparameters
    peer.SendEvent(eventData, new SendParameters { ChannelId = <your-channel-id> }
    
  • Sergiy
    Options
    Clear. Thanks, Philip.