Cannot send op: Selected channel (2)>= channelCount (2)
Options
Can someone tell me why this error is occuring? DebugReturn() is being called with:
ERROR: Cannot send op: Selected channel (2)>= channelCount (2).
I am calling the operation something like this. It looks like the default max channels is 256, so I'm not sure why it's erroring out?
[code2=csharp]opParams.Clear();
opParams[ (byte) OpParam.PeerId ] = peerId;
peer.OpCustom( (byte) OpCode.GetRank, opParams, true, (byte) ChannelId.Leaderboard);
peer.SendOutgoingCommands();[/code2]
thanks
ERROR: Cannot send op: Selected channel (2)>= channelCount (2).
I am calling the operation something like this. It looks like the default max channels is 256, so I'm not sure why it's erroring out?
[code2=csharp]opParams.Clear();
opParams[ (byte) OpParam.PeerId ] = peerId;
peer.OpCustom( (byte) OpCode.GetRank, opParams, true, (byte) ChannelId.Leaderboard);
peer.SendOutgoingCommands();[/code2]
thanks
0
Comments
-
By default channels are limited to 2, being 0 and 1.
The client defines how many channels are available. One channel is set aside as "internal", being 255, so you end up with 254 available.
Actually, channels don't do a lot for you, except being separate streams of commands / messages. They are all ordered independently, so if one reliable command is missing in channel 0, anything received in channel 1 can be executed despite missing messages in the other channel.0 -
Tobias, OK but how can I prevent the error? That code is my client code. I think I understand what the channels do. Thanks0
-
Which client SDK are you using? Some SDKs have a setting named "channel count" or similar, which you could set to a value > 2.
But it's not supported in all client SDKs - in case you don't have a setting like this, you can only use the default channels 0 + 1.0 -
Hey Nicole, sorry I must have missed your reply. I am using
Photon-Unity3D_v3-2
I will try just setting the ChannelCount property on the peer after connecting. Not sure why I didnt try that before0 -
Raise the ChannelCount before you connect.
PhotonNetwork.networkingPeer.ChannelCount = channelsRequired + 1;
"The default ChannelCount is 2. Channel IDs start with 0 and 255 is a internal channel."
Hope this helps.0