Beispiel #1
0
        /// <summary>Channel reliable</summary>
        /// <param name="network">Network</param>
        /// <param name="link">Link</param>
        public ChannelReliable(Network network, Link link)
        {
            // Initializes tables
            Attempts = new AsyncTable <uint, uint>();
            Contents = new AsyncTable <uint, Content>();
            Cached   = new AsyncTable <ushort, Content>();
            Acks     = new AsyncTable <ushort, uint>();

            Network = network;
            Link    = link;
        }
Beispiel #2
0
        /// <summary>Network</summary>
        /// <param name="settings">Settings</param>
        public Network(Settings settings)
        {
            // Links indexed by end point
            LinksByEndPoint = new AsyncTable <EndPoint, Link>();

            // Event queues
            Events = new AsyncQueue <RaiseEvent>();

            // Statistics
            Statistics = new Statistics();

            // Settings
            Settings = settings;


            /*/ Debug events
             * OnApproval   += (link, content) => {Debug.Log("[NETWORK] Approval   {0}",     link.Address);};
             * OnLinked     += (link)          => {Debug.Log("[NETWORK] Linked     {0}",     link.Address);};
             * OnUnlinked   += (link, reason)  => {Debug.Log("[NETWORK] Unlinked   {0} {1}", link.Address, reason);};
             * OnRedirect   += (link)          => {Debug.Log("[NETWORK] Redirect   {0}",     link.Address);};
             * OnRedirected += (link)          => {Debug.Log("[NETWORK] Redirected {0}",     link.Address);};
             * OnFailed     += (link, failure) => {Debug.Log("[NETWORK] Unlinked   {0} {1}", link.Address, failure);};
             */
        }