Esempio n. 1
0
        public Hub(HubSetting infav, IBaseUpdater gui)
            : base(infav.Address, infav.Port)
        {
            fav = infav;    // Sets Favorites.
            me  = new User(fav.DisplayName);
            me.UserInfo.Description = fav.UserDescription;
            me.Tag.Version          = "FlowLib";

            UpdateRegMode();
            UpdateShare();
            #region Event(s)
            UnknownProtocolId = new FmdcEventHandler(OnUnknownProtocolId);
            RegModeUpdated   += new FmdcEventHandler(Hub_RegModeUpdated);
            ProtocolChange   += new FmdcEventHandler(Hub_ProtocolChange);
            #endregion
            #region Event(s)
            if (gui != null)
            {
                gui.UpdateBase += new FmdcEventHandler(OnUpdateBase);
                baseUpdater     = gui;
            }
            #endregion
            //FireUpdate(Actions.Name, new HubName(HubSetting.Address + ":" + HubSetting.Port.ToString()));
            #region Keep Alive
            // For Connection Keepalive
            TimerCallback timerDelegate = new TimerCallback(OnkeepAliveTimer_Elapsed);
            keepAliveTimer = new System.Threading.Timer(timerDelegate, socket, interval * 1000, interval * 1000);
            #endregion
        }
Esempio n. 2
0
        public Hub(HubSetting infav, IBaseUpdater gui)
            : base(infav.Address, infav.Port)
        {
            fav = infav;    // Sets Favorites.
            me = new User(fav.DisplayName);
            me.UserInfo.Description = fav.UserDescription;
            me.Tag.Version = "FlowLib";

            UpdateRegMode();
            UpdateShare();
            #region Event(s)
            UnknownProtocolId = new FmdcEventHandler(OnUnknownProtocolId);
            RegModeUpdated += new FmdcEventHandler(Hub_RegModeUpdated);
            ProtocolChange += new FmdcEventHandler(Hub_ProtocolChange);
            #endregion
            #region Event(s)
            if (gui != null)
            {
                gui.UpdateBase += new FmdcEventHandler(OnUpdateBase);
                baseUpdater = gui;
            }
            #endregion
            //FireUpdate(Actions.Name, new HubName(HubSetting.Address + ":" + HubSetting.Port.ToString()));
            #region Keep Alive
            // For Connection Keepalive
            TimerCallback timerDelegate = new TimerCallback(OnkeepAliveTimer_Elapsed);
            keepAliveTimer = new System.Threading.Timer(timerDelegate, socket, interval * 1000, interval * 1000);
            #endregion
        }
Esempio n. 3
0
 public UPnP(IPEndPoint point, IBaseUpdater updater)
 {
     RootDevices = new SortedList<string, UPnPDevice>();
     if (point == null)
         point = new IPEndPoint(IPAddress.Parse("239.255.255.250"), 1900);
     EndPoint = point;
     if (updater != null)
     {
         updater.UpdateBase += new FlowLib.Events.FmdcEventHandler(OnUpdateBase);
         this.updater = updater;
     }
     client = new Socket(AddressFamily.InterNetwork,
     SocketType.Dgram, ProtocolType.Udp);
     ProtocolUPnP = new UPnPProtocol(this);
 }
Esempio n. 4
0
 public UPnP(IPEndPoint point, IBaseUpdater updater)
 {
     RootDevices = new SortedList <string, UPnPDevice>();
     if (point == null)
     {
         point = new IPEndPoint(IPAddress.Parse("239.255.255.250"), 1900);
     }
     EndPoint = point;
     if (updater != null)
     {
         updater.UpdateBase += new FlowLib.Events.FmdcEventHandler(OnUpdateBase);
         this.updater        = updater;
     }
     client = new Socket(AddressFamily.InterNetwork,
                         SocketType.Dgram, ProtocolType.Udp);
     ProtocolUPnP = new UPnPProtocol(this);
 }
Esempio n. 5
0
 public UPnP(IBaseUpdater updater, string searchTarget)
     : this(null, updater, searchTarget)
 {
 }
Esempio n. 6
0
 public UPnP(IPEndPoint point, IBaseUpdater updater)
     : this(point, updater, null)
 {
 }
Esempio n. 7
0
 public UPnP(IBaseUpdater updater)
     : this(null, updater)
 {
 }
Esempio n. 8
0
 public UPnP(IBaseUpdater updater, string searchTarget) : this(null, updater, searchTarget)
 {
 }
Esempio n. 9
0
 public UPnP(IPEndPoint point, IBaseUpdater updater) : this(point, updater, null)
 {
 }
Esempio n. 10
0
 public UPnP(IBaseUpdater updater) : this(null, updater)
 {
 }