/// <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; } }
/// <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; } }
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); }
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); }