Beispiel #1
0
        public void Dispose()
        {
            bool flag = this.m_Ptr != IntPtr.Zero;

            if (flag)
            {
                ConnectionConfigInternal.InternalDestroy(this.m_Ptr);
                this.m_Ptr = IntPtr.Zero;
            }
        }
Beispiel #2
0
        protected virtual void Dispose(bool disposing)
        {
            bool flag = this.m_Ptr != IntPtr.Zero;

            if (flag)
            {
                ConnectionConfigInternal.InternalDestroy(this.m_Ptr);
                this.m_Ptr = IntPtr.Zero;
            }
        }
 public HostTopologyInternal(HostTopology topology)
 {
     ConnectionConfigInternal config = new ConnectionConfigInternal(topology.DefaultConfig);
     this.InitWrapper(config, topology.MaxDefaultConnections);
     for (int i = 1; i <= topology.SpecialConnectionConfigsCount; i++)
     {
         ConnectionConfigInternal internal3 = new ConnectionConfigInternal(topology.GetSpecialConnectionConfig(i));
         this.AddSpecialConnectionConfig(internal3);
     }
     this.InitOtherParameters(topology);
 }
        public HostTopologyInternal(HostTopology topology)
        {
            ConnectionConfigInternal config = new ConnectionConfigInternal(topology.DefaultConfig);

            this.InitWrapper(config, topology.MaxDefaultConnections);
            for (int i = 1; i <= topology.SpecialConnectionConfigsCount; i++)
            {
                ConnectionConfigInternal internal3 = new ConnectionConfigInternal(topology.GetSpecialConnectionConfig(i));
                this.AddSpecialConnectionConfig(internal3);
            }
            this.InitOtherParameters(topology);
        }
        public HostTopologyInternal(HostTopology topology)
        {
            ConnectionConfigInternal config = new ConnectionConfigInternal(topology.DefaultConfig);

            m_Ptr = InternalCreate(config, topology.MaxDefaultConnections);
            for (int i = 1; i <= topology.SpecialConnectionConfigsCount; ++i)
            {
                ConnectionConfig         conf    = topology.GetSpecialConnectionConfig(i);
                ConnectionConfigInternal confInt = new ConnectionConfigInternal(conf);
                AddSpecialConnectionConfig(confInt);
            }
            this.ReceivedMessagePoolSize     = topology.ReceivedMessagePoolSize;
            this.SentMessagePoolSize         = topology.SentMessagePoolSize;
            this.MessagePoolSizeGrowthFactor = topology.MessagePoolSizeGrowthFactor;
        }
 private int AddSpecialConnectionConfig(ConnectionConfigInternal config)
 {
     return(this.AddSpecialConnectionConfigWrapper(config));
 }
 public int AddSpecialConnectionConfigWrapper(ConnectionConfigInternal config);
 private int AddSpecialConnectionConfig(ConnectionConfigInternal config)
 {
   return this.AddSpecialConnectionConfigWrapper(config);
 }
 public void InitWrapper(ConnectionConfigInternal config, int maxDefaultConnections);
 public extern ushort AddSpecialConnectionConfig(ConnectionConfigInternal config);
 private static extern IntPtr InternalCreate(ConnectionConfigInternal config, int maxDefaultConnections);
Beispiel #12
0
 public int AddSpecialConnectionConfigWrapper(ConnectionConfigInternal config)
 {
     throw new NotImplementedException("なにこれ");
 }
Beispiel #13
0
 public void InitWrapper(ConnectionConfigInternal config, int maxDefaultConnections)
 {
     throw new NotImplementedException("なにこれ");
 }
 public extern int AddSpecialConnectionConfigWrapper(ConnectionConfigInternal config);
Beispiel #15
0
 private int AddSpecialConnectionConfig(ConnectionConfigInternal config) =>
 this.AddSpecialConnectionConfigWrapper(config);
 public extern void InitWrapper(ConnectionConfigInternal config, int maxDefaultConnections);
Beispiel #17
0
        public ConnectionConfigInternal(ConnectionConfig config)
        {
            bool flag = config == null;

            if (flag)
            {
                throw new NullReferenceException("config is not defined");
            }
            this.m_Ptr = ConnectionConfigInternal.InternalCreate();
            bool flag2 = !this.SetPacketSize(config.PacketSize);

            if (flag2)
            {
                throw new ArgumentOutOfRangeException("PacketSize is too small");
            }
            this.FragmentSize          = config.FragmentSize;
            this.ResendTimeout         = config.ResendTimeout;
            this.DisconnectTimeout     = config.DisconnectTimeout;
            this.ConnectTimeout        = config.ConnectTimeout;
            this.MinUpdateTimeout      = config.MinUpdateTimeout;
            this.PingTimeout           = config.PingTimeout;
            this.ReducedPingTimeout    = config.ReducedPingTimeout;
            this.AllCostTimeout        = config.AllCostTimeout;
            this.NetworkDropThreshold  = config.NetworkDropThreshold;
            this.OverflowDropThreshold = config.OverflowDropThreshold;
            this.MaxConnectionAttempt  = config.MaxConnectionAttempt;
            this.AckDelay  = config.AckDelay;
            this.SendDelay = config.SendDelay;
            this.MaxCombinedReliableMessageSize  = config.MaxCombinedReliableMessageSize;
            this.MaxCombinedReliableMessageCount = config.MaxCombinedReliableMessageCount;
            this.MaxSentMessageQueueSize         = config.MaxSentMessageQueueSize;
            this.AcksType = (byte)config.AcksType;
            this.UsePlatformSpecificProtocols  = config.UsePlatformSpecificProtocols;
            this.InitialBandwidth              = config.InitialBandwidth;
            this.BandwidthPeakFactor           = config.BandwidthPeakFactor;
            this.WebSocketReceiveBufferMaxSize = config.WebSocketReceiveBufferMaxSize;
            this.UdpSocketReceiveBufferMaxSize = config.UdpSocketReceiveBufferMaxSize;
            bool flag3 = config.SSLCertFilePath != null;

            if (flag3)
            {
                int  num   = this.SetSSLCertFilePath(config.SSLCertFilePath);
                bool flag4 = num != 0;
                if (flag4)
                {
                    throw new ArgumentOutOfRangeException("SSLCertFilePath cannot be > than " + num.ToString());
                }
            }
            bool flag5 = config.SSLPrivateKeyFilePath != null;

            if (flag5)
            {
                int  num2  = this.SetSSLPrivateKeyFilePath(config.SSLPrivateKeyFilePath);
                bool flag6 = num2 != 0;
                if (flag6)
                {
                    throw new ArgumentOutOfRangeException("SSLPrivateKeyFilePath cannot be > than " + num2.ToString());
                }
            }
            bool flag7 = config.SSLCAFilePath != null;

            if (flag7)
            {
                int  num3  = this.SetSSLCAFilePath(config.SSLCAFilePath);
                bool flag8 = num3 != 0;
                if (flag8)
                {
                    throw new ArgumentOutOfRangeException("SSLCAFilePath cannot be > than " + num3.ToString());
                }
            }
            byte b = 0;

            while ((int)b < config.ChannelCount)
            {
                this.AddChannel((int)((byte)config.GetChannel(b)));
                b += 1;
            }
            byte b2 = 0;

            while ((int)b2 < config.SharedOrderChannelCount)
            {
                IList <byte> sharedOrderChannels = config.GetSharedOrderChannels(b2);
                byte[]       array = new byte[sharedOrderChannels.Count];
                sharedOrderChannels.CopyTo(array, 0);
                this.MakeChannelsSharedOrder(array);
                b2 += 1;
            }
        }