Ejemplo n.º 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;
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 3
0
 internal ToxOptions(ToxOptionsStruct options)
 {
     _options = options;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 7
0
 internal ToxOptions(ToxOptionsStruct options)
 {
     _options = options;
 }
Ejemplo n.º 8
0
 internal static extern void OptionsFree(ref ToxOptionsStruct options);
Ejemplo n.º 9
0
 internal static extern void OptionsDefault(ref ToxOptionsStruct options);
Ejemplo n.º 10
0
 internal static extern ToxHandle New(ref ToxOptionsStruct options, ref ToxErrorNew error);
Ejemplo n.º 11
0
 internal static extern void OptionsFree(ref ToxOptionsStruct options);
Ejemplo n.º 12
0
 internal static extern void OptionsDefault(ref ToxOptionsStruct options);
Ejemplo n.º 13
0
 internal static extern ToxHandle New(ref ToxOptionsStruct options, ref ToxErrorNew error);