Exemplo n.º 1
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="routerEP">Physical endpoint of the sending router.</param>
 /// <param name="routerInfo">The sending router's capability information.</param>
 /// <param name="isUplink"><c>true</c> if the sender side is an uplink.</param>
 /// <param name="listenPort">The listening port.</param>
 public TcpInitMsg(MsgEP routerEP, MsgRouterInfo routerInfo, bool isUplink, int listenPort)
 {
     this._Flags     = MsgFlag.Priority;
     this.RouterEP   = routerEP;
     this.RouterInfo = routerInfo;
     this.IsUplink   = isUplink;
     this.ListenPort = listenPort;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="childEP">Endpoint of the child router sending the message.</param>
 /// <param name="appName">Name of the application hosting the child router.</param>
 /// <param name="appDescription">Description of the hosting application.</param>
 /// <param name="routerInfo">The router's capability information.</param>
 /// <param name="logicalEndpointSetID">The GUID identifying the current set of logical endpoints handled by the router.</param>
 public HubKeepAliveMsg(MsgEP childEP, string appName, string appDescription, MsgRouterInfo routerInfo, Guid logicalEndpointSetID)
 {
     this._Flags               = MsgFlag.Priority;
     this.ChildEP              = childEP;
     this.AppName              = appName;
     this.AppDescription       = appDescription;
     this.RouterInfo           = routerInfo;
     this.LogicalEndpointSetID = logicalEndpointSetID;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="hubEP">The hub router's endpoint.</param>
        /// <param name="appName">The name of the application hosting the router.</param>
        /// <param name="appDescription">A description of the application.</param>
        /// <param name="routerInfo">The hub router's capability information.</param>
        /// <param name="logicalEndpointSetID">The GUID identifying the current set of logical endpoints implemented by the router.</param>
        public HubAdvertiseMsg(MsgEP hubEP, string appName, string appDescription, MsgRouterInfo routerInfo, Guid logicalEndpointSetID)
        {
            Assertion.Test(hubEP.IsPhysical);

            this._Flags               = MsgFlag.Priority;
            this.HubEP                = hubEP;
            this.AppName              = appName;
            this.AppDescription       = appDescription;
            this.RouterInfo           = routerInfo;
            this.LogicalEndpointSetID = logicalEndpointSetID;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="routerEP">The router's physical endpoint.</param>
        /// <param name="appName">The name of the application hosting the router.</param>
        /// <param name="appDescription">A description of the application.</param>
        /// <param name="routerInfo">The router's capability information.</param>
        /// <param name="udpPort">The UDP port the router is monitoring.</param>
        /// <param name="tcpPort">The TCP port the router is monitoring.</param>
        /// <param name="logicalEndpointSetID">The GUID identifying the current set of logical endpoints handled by the router.</param>
        /// <param name="replyAdvertise"><c>true</c> if the receiving router should reply with a RouterAdvertiseMsg of its own.</param>
        /// <param name="discoverLogical"><c>true</c> if the receiving router should reply with LogicalAdvertiseMsgs.</param>
        public RouterAdvertiseMsg(MsgEP routerEP, string appName, string appDescription,
                                  MsgRouterInfo routerInfo, int udpPort, int tcpPort,
                                  Guid logicalEndpointSetID, bool replyAdvertise, bool discoverLogical)
        {
            Assertion.Test(routerEP.IsPhysical);

            this._Flags               = MsgFlag.Priority;
            this.RouterEP             = routerEP;
            this.AppName              = appName;
            this.AppDescription       = appDescription;
            this.RouterInfo           = routerInfo;
            this.UdpPort              = udpPort;
            this.TcpPort              = tcpPort;
            this.LogicalEndpointSetID = logicalEndpointSetID;
            this.ReplyAdvertise       = replyAdvertise;
            this.DiscoverLogical      = discoverLogical;
        }
Exemplo n.º 5
0
        public void Misc_RouterInfo()
        {
            MsgRouterInfo caps;

            caps = MsgRouterInfo.Default;
            Assert.AreEqual(MsgRouterInfo.CurrentProtocolVersion, caps.ProtocolVersion);
            Assert.AreEqual(new Version(Build.Version), caps.BuildVersion);
            Assert.IsTrue(caps.IsP2P);
            Assert.IsTrue(caps.ReceiptSend);
            Assert.IsTrue(caps.DeadRouterDetect);
            Assert.AreEqual(Helper.MachineName, caps.MachineName);

            caps = new MsgRouterInfo(caps.ToString());
            Assert.AreEqual(MsgRouterInfo.CurrentProtocolVersion, caps.ProtocolVersion);
            Assert.AreEqual(new Version(Build.Version), caps.BuildVersion);
            Assert.IsTrue(caps.IsP2P);
            Assert.IsTrue(caps.ReceiptSend);
            Assert.IsTrue(caps.DeadRouterDetect);
            Assert.AreEqual(Helper.MachineName, caps.MachineName);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="logicalEPs">The set of logical endpoints being advertised.</param>
        /// <param name="routerEP">The advertising router's physical endpoint.</param>
        /// <param name="appName">Name of the application hosting the advertising router.</param>
        /// <param name="appDescription">Description of the hosting application.</param>
        /// <param name="routerInfo">The router's capability information.</param>
        /// <param name="udpPort">The UDP port the router is monitoring.</param>
        /// <param name="tcpPort">The TCP port the router is monitoring.</param>
        /// <param name="logicalEndpointSetID">The GUID identifying the current set of logical endpoints handled by the router.</param>
        public LogicalAdvertiseMsg(MsgEP[] logicalEPs, MsgEP routerEP, string appName, string appDescription, MsgRouterInfo routerInfo,
                                   int udpPort, int tcpPort, Guid logicalEndpointSetID)
        {
            for (int i = 0; i < logicalEPs.Length; i++)
            {
                Assertion.Test(logicalEPs[i].IsLogical);
                base[string.Format("ep[{0}]", i)] = logicalEPs[i].ToString();
            }

            this._Flags               = MsgFlag.Priority;
            this.cEPs                 = logicalEPs.Length;
            this.RouterEP             = routerEP;
            this.AppName              = appName;
            this.AppDescription       = appDescription;
            this.RouterInfo           = routerInfo;
            this.UdpPort              = udpPort;
            this.TcpPort              = tcpPort;
            this.LogicalEndpointSetID = logicalEndpointSetID;
        }
Exemplo n.º 7
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="routerEP">The advertising router's physical endpoint.</param>
 /// <param name="appName">The name of the application hosting the router.</param>
 /// <param name="appDescription">A description of the application.</param>
 /// <param name="routerInfo">The router's capability information.</param>
 /// <param name="udpPort">The UDP port the router is monitoring.</param>
 /// <param name="tcpPort">The TCP port the router is monitoring.</param>
 /// <param name="logicalEndpointSetID">The GUID identifying the current set of logical endpoints handled by the router.</param>
 public LogicalAdvertiseMsg(MsgEP routerEP, string appName, string appDescription, MsgRouterInfo routerInfo,
                            int udpPort, int tcpPort, Guid logicalEndpointSetID)
 {
     this._Flags               = MsgFlag.Priority;
     this.RouterEP             = routerEP;
     this.AppName              = appName;
     this.AppDescription       = AppDescription;
     this.RouterInfo           = routerInfo;
     this.cEPs                 = 0;
     this.UdpPort              = udpPort;
     this.TcpPort              = tcpPort;
     this.LogicalEndpointSetID = logicalEndpointSetID;
 }