Exemplo n.º 1
0
 /// <summary>
 /// Set option with a bool value on this connection
 /// </summary>
 /// <param name="option">The option to set</param>
 /// <param name="value">The value</param>
 public void SetOption(UdpConnectionOption option, bool value)
 {
     switch (option)
     {
     case UdpConnectionOption.AlwaysSendMtu:
         socket.Raise(UdpEvent.INTERNAL_CONNECTION_OPTION, this, option, value ? 1 : 0);
         break;
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Set option with a int value on this connection
 /// </summary>
 /// <param name="option">The option to set</param>
 /// <param name="value">The value</param>
 public void SetOption(UdpConnectionOption option, int value)
 {
     switch (option)
     {
     case UdpConnectionOption.MtuSize:
         socket.Raise(UdpEvent.INTERNAL_CONNECTION_OPTION, this, option, value);
         break;
     }
 }
Exemplo n.º 3
0
        internal void Raise(int eventType, UdpConnection connection, UdpConnectionOption option, int value)
        {
            UdpEvent ev = new UdpEvent();

            ev.Type           = eventType;
            ev.Connection     = connection;
            ev.Option         = option;
            ev.OptionIntValue = value;
            Raise(ev);
        }
Exemplo n.º 4
0
        public static IUnityContainer AddLocalConnectionTable(this IUnityContainer services)
        {
            //use default
            var redistributableOption = new RedistributableTableOption();
            var searchTableOption     = new UdpConnectionOption {
                Address = IPAddress.Any, Port = 33100
            };
            var table    = new RedistLocalConnectionTable(searchTableOption, redistributableOption);
            var settings = services.Resolve <RadioSettings>();

            var localEp          = new IPEndPoint(settings.LocalIp, searchTableOption.Port);
            var notificationData = new NotificationData {
                Id = settings.NetworkToken, Endpoint = localEp
            };

            table.Register(notificationData);
            services.RegisterInstance <IRedistributableLocalConnectionTable>(table, new SingletonLifetimeManager());

            return(services);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Set option with a int value on this connection
 /// </summary>
 /// <param name="option">The option to set</param>
 /// <param name="value">The value</param>
 public void SetOption(UdpConnectionOption option, int value)
 {
     switch (option) {
         case UdpConnectionOption.MtuSize:
             socket.Raise(UdpEvent.INTERNAL_CONNECTION_OPTION, this, option, value);
             break;
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// Set option with a bool value on this connection
 /// </summary>
 /// <param name="option">The option to set</param>
 /// <param name="value">The value</param>
 public void SetOption(UdpConnectionOption option, bool value)
 {
     switch (option) {
         case UdpConnectionOption.AlwaysSendMtu:
             socket.Raise(UdpEvent.INTERNAL_CONNECTION_OPTION, this, option, value ? 1 : 0);
             break;
     }
 }