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