Exemple #1
0
        /// <summary>
        /// Submit a task to the thread pool to register prefix with the connected
        /// forwarder and call onInterest when a matching interest is received. To
        /// register a prefix with NFD, you must first call setCommandSigningInfo.
        /// </summary>
        ///
        /// <param name="prefix_0">A Name for the prefix to register. This copies the Name.</param>
        /// <param name="onInterest">onInterest.onInterest(prefix, interest, face, interestFilterId, filter). The onInterest callback should supply the Data with face.putData(). NOTE: You must not change the prefix or filter objects - if you need to change them then make a copy. If onInterest is null, it is ignored and you must call setInterestFilter. NOTE: The library will log any exceptions thrown by this callback, but for better error handling the callback should catch and properly handle any exceptions.</param>
        /// <param name="onRegisterFailed">NOTE: The library will log any exceptions thrown by this callback, but for better error handling the callback should catch and properly handle any exceptions.</param>
        /// <param name="onRegisterSuccess">receives a success message from the forwarder. If onRegisterSuccess is null, this does not use it. (The onRegisterSuccess parameter comes after onRegisterFailed because it can be null or omitted, unlike onRegisterFailed.) NOTE: The library will log any exceptions thrown by this callback, but for better error handling the callback should catch and properly handle any exceptions.</param>
        /// <param name="flags_1"></param>
        /// <param name="wireFormat_2">A WireFormat object used to encode the message.</param>
        /// <returns>The registered prefix ID which can be used with
        /// removeRegisteredPrefix.</returns>
        public override long registerPrefix(Name prefix_0,
                                            OnInterestCallback onInterest, OnRegisterFailed onRegisterFailed,
                                            OnRegisterSuccess onRegisterSuccess, ForwardingFlags flags_1,
                                            WireFormat wireFormat_2)
        {
            long registeredPrefixId_3 = node_.getNextEntryId();

            // Wrap callbacks to submit to the thread pool.
            OnInterestCallback finalOnInterest_4  = onInterest;
            OnInterestCallback onInterestSubmit_5 = (onInterest == null) ? null
                                        : new ThreadPoolFace.Anonymous_C6(this, finalOnInterest_4);

            OnRegisterFailed finalOnRegisterFailed_6  = onRegisterFailed;
            OnRegisterFailed onRegisterFailedSubmit_7 = new ThreadPoolFace.Anonymous_C5(this, finalOnRegisterFailed_6);

            // Wrap callbacks to submit to the thread pool.
            OnRegisterSuccess finalOnRegisterSuccess_8  = onRegisterSuccess;
            OnRegisterSuccess onRegisterSuccessSubmit_9 = (onRegisterSuccess == null) ? null
                                        : new ThreadPoolFace.Anonymous_C4(this, finalOnRegisterSuccess_8);

            threadPool_.submit(new ThreadPoolFace.Anonymous_C3(this, wireFormat_2, onRegisterSuccessSubmit_9, prefix_0,
                                                               flags_1, onInterestSubmit_5, onRegisterFailedSubmit_7,
                                                               registeredPrefixId_3));

            return(registeredPrefixId_3);
        }
                public Anonymous_C17(ThreadPoolFace.Anonymous_C5  paramouter_Anonymous_C5,
										Name localPrefix_0)
                {
                    this.localPrefix = localPrefix_0;
                                    this.outer_Anonymous_C5 = paramouter_Anonymous_C5;
                }
Exemple #3
0
 public Anonymous_C17(ThreadPoolFace.Anonymous_C5 paramouter_Anonymous_C5,
                      Name localPrefix_0)
 {
     this.localPrefix        = localPrefix_0;
     this.outer_Anonymous_C5 = paramouter_Anonymous_C5;
 }
        /// <summary>
        /// Submit a task to the thread pool to register prefix with the connected
        /// forwarder and call onInterest when a matching interest is received. To
        /// register a prefix with NFD, you must first call setCommandSigningInfo.
        /// </summary>
        ///
        /// <param name="prefix_0">A Name for the prefix to register. This copies the Name.</param>
        /// <param name="onInterest">onInterest.onInterest(prefix, interest, face, interestFilterId, filter). The onInterest callback should supply the Data with face.putData(). NOTE: You must not change the prefix or filter objects - if you need to change them then make a copy. If onInterest is null, it is ignored and you must call setInterestFilter. NOTE: The library will log any exceptions thrown by this callback, but for better error handling the callback should catch and properly handle any exceptions.</param>
        /// <param name="onRegisterFailed">NOTE: The library will log any exceptions thrown by this callback, but for better error handling the callback should catch and properly handle any exceptions.</param>
        /// <param name="onRegisterSuccess">receives a success message from the forwarder. If onRegisterSuccess is null, this does not use it. (The onRegisterSuccess parameter comes after onRegisterFailed because it can be null or omitted, unlike onRegisterFailed.) NOTE: The library will log any exceptions thrown by this callback, but for better error handling the callback should catch and properly handle any exceptions.</param>
        /// <param name="flags_1"></param>
        /// <param name="wireFormat_2">A WireFormat object used to encode the message.</param>
        /// <returns>The registered prefix ID which can be used with
        /// removeRegisteredPrefix.</returns>
        public override long registerPrefix(Name prefix_0,
				OnInterestCallback onInterest, OnRegisterFailed onRegisterFailed,
				OnRegisterSuccess onRegisterSuccess, ForwardingFlags flags_1,
				WireFormat wireFormat_2)
        {
            long registeredPrefixId_3 = node_.getNextEntryId();

            // Wrap callbacks to submit to the thread pool.
            OnInterestCallback finalOnInterest_4 = onInterest;
            OnInterestCallback onInterestSubmit_5 = (onInterest == null) ? null
                    : new ThreadPoolFace.Anonymous_C6 (this, finalOnInterest_4);

            OnRegisterFailed finalOnRegisterFailed_6 = onRegisterFailed;
            OnRegisterFailed onRegisterFailedSubmit_7 = new ThreadPoolFace.Anonymous_C5 (this, finalOnRegisterFailed_6);

            // Wrap callbacks to submit to the thread pool.
            OnRegisterSuccess finalOnRegisterSuccess_8 = onRegisterSuccess;
            OnRegisterSuccess onRegisterSuccessSubmit_9 = (onRegisterSuccess == null) ? null
                    : new ThreadPoolFace.Anonymous_C4 (this, finalOnRegisterSuccess_8);

            threadPool_.submit(new ThreadPoolFace.Anonymous_C3 (this, onRegisterSuccessSubmit_9, onRegisterFailedSubmit_7,
                    prefix_0, onInterestSubmit_5, flags_1, wireFormat_2, registeredPrefixId_3));

            return registeredPrefixId_3;
        }