예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ToxOptions"/> struct.
 /// </summary>
 /// <param name="ipv6Enabled">Whether or not IPv6 should be enabled.</param>
 /// <param name="udpEnabled">Whether or not UDP should be enabled.</param>
 public ToxOptions(bool ipv6Enabled, bool udpEnabled)
 {
     _options                       = new ToxOptionsStruct();
     _options.Ipv6Enabled           = ipv6Enabled;
     _options.UdpEnabled            = udpEnabled;
     _options.LocalDiscoveryEnabled = true;
     _options.HolePunchingEnabled   = true;
 }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ToxOptions"/> struct.
        /// </summary>
        /// <param name="ipv6Enabled">Whether or not IPv6 should be enabled.</param>
        /// <param name="type">The type of proxy we want to connect to.</param>
        /// <param name="proxyAddress">The IP address or DNS name of the proxy to be used.</param>
        /// <param name="proxyPort">The port to use to connect to the proxy.</param>
        public ToxOptions(bool ipv6Enabled, ToxProxyType type, string proxyAddress, int proxyPort)
        {
            if (string.IsNullOrEmpty(proxyAddress))
            {
                throw new ArgumentNullException("proxyAddress");
            }

            if (proxyAddress.Length > 255)
            {
                throw new Exception("Parameter proxyAddress is too long.");
            }

            _options             = new ToxOptionsStruct();
            _options.Ipv6Enabled = ipv6Enabled;
            _options.UdpEnabled  = false;
            _options.ProxyType   = type;
            _options.ProxyHost   = proxyAddress;
            _options.ProxyPort   = (ushort)proxyPort;
        }
예제 #3
0
 internal ToxOptions(ToxOptionsStruct options)
 {
     _options = options;
 }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ToxOptions"/> struct.
 /// </summary>
 /// <param name="ipv6Enabled">Whether or not IPv6 should be enabled.</param>
 /// <param name="udpEnabled">Whether or not UDP should be enabled.</param>
 public ToxOptions(bool ipv6Enabled, bool udpEnabled)
 {
     _options             = new ToxOptionsStruct();
     _options.Ipv6Enabled = ipv6Enabled;
     _options.UdpEnabled  = udpEnabled;
 }
예제 #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ToxOptions"/> struct.
        /// </summary>
        /// <param name="ipv6Enabled">Whether or not IPv6 should be enabled.</param>
        /// <param name="type">The type of proxy we want to connect to.</param>
        /// <param name="proxyAddress">The IP address or DNS name of the proxy to be used.</param>
        /// <param name="proxyPort">The port to use to connect to the proxy.</param>
        public ToxOptions(bool ipv6Enabled, ToxProxyType type, string proxyAddress, int proxyPort)
        {
            if (string.IsNullOrEmpty(proxyAddress))
                throw new ArgumentNullException("proxyAddress");

            if (proxyAddress.Length > 255)
                throw new Exception("Parameter proxyAddress is too long.");

            _options = new ToxOptionsStruct();
            _options.Ipv6Enabled = ipv6Enabled;
            _options.UdpEnabled = false;
            _options.ProxyType = type;
            _options.ProxyHost = proxyAddress;
            _options.ProxyPort = (ushort)proxyPort;
        }
예제 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ToxOptions"/> struct.
 /// </summary>
 /// <param name="ipv6Enabled">Whether or not IPv6 should be enabled.</param>
 /// <param name="udpEnabled">Whether or not UDP should be enabled.</param>
 public ToxOptions(bool ipv6Enabled, bool udpEnabled)
 {
     _options = new ToxOptionsStruct();
     _options.Ipv6Enabled = ipv6Enabled;
     _options.UdpEnabled = udpEnabled;
 }
예제 #7
0
 internal ToxOptions(ToxOptionsStruct options)
 {
     _options = options;
 }
예제 #8
0
 internal static extern void OptionsFree(ref ToxOptionsStruct options);
예제 #9
0
 internal static extern void OptionsDefault(ref ToxOptionsStruct options);
예제 #10
0
 internal static extern ToxHandle New(ref ToxOptionsStruct options, ref ToxErrorNew error);
예제 #11
0
 internal static extern void OptionsFree(ref ToxOptionsStruct options);
예제 #12
0
 internal static extern void OptionsDefault(ref ToxOptionsStruct options);
예제 #13
0
 internal static extern ToxHandle New(ref ToxOptionsStruct options, ref ToxErrorNew error);