UnityEngine.Networking.NetworkConnection.SetChannelOption C# (CSharp) Method

SetChannelOption() public method

This sets an option on the network channel.

public SetChannelOption ( int channelId, ChannelOption option, int value ) : bool
channelId int The channel the option will be set on.
option ChannelOption The option to set.
value int The value for the option.
return bool
        public bool SetChannelOption(int channelId, ChannelOption option, int value)
        {
            if (this.m_Channels == null)
            {
                return false;
            }
            if ((channelId < 0) || (channelId >= this.m_Channels.Length))
            {
                return false;
            }
            return this.m_Channels[channelId].SetOption(option, value);
        }

Usage Example

コード例 #1
0
 public override void OnServerConnect(NetworkConnection conn)
 {
     conn.SetChannelOption(Channels.DefaultReliable, ChannelOption.MaxPendingBuffers, 500);
 }