[ 
https://issues.apache.org/jira/browse/PROTON-2370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17325301#comment-17325301
 ] 

ASF GitHub Bot commented on PROTON-2370:
----------------------------------------

jiridanek commented on a change in pull request #309:
URL: https://github.com/apache/qpid-proton/pull/309#discussion_r616151542



##########
File path: cpp/src/delivery_test.cpp
##########
@@ -0,0 +1,139 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include <proton/connection.hpp>
+#include <proton/connection_options.hpp>
+#include <proton/container.hpp>
+#include <proton/delivery.h>
+#include <proton/delivery.hpp>
+#include <proton/link.hpp>
+#include <proton/listen_handler.hpp>
+#include <proton/listener.hpp>
+#include <proton/message.hpp>
+#include <proton/message_id.hpp>
+#include <proton/messaging_handler.hpp>
+#include <proton/tracker.hpp>
+#include <proton/types.h>
+#include <proton/types.hpp>
+#include <proton/value.hpp>
+
+#include "proton/error_condition.hpp"
+#include "proton/internal/pn_unique_ptr.hpp"
+#include "proton/receiver_options.hpp"
+#include "proton/transport.hpp"
+#include "proton/work_queue.hpp"
+#include "test_bits.hpp"
+
+#include <condition_variable>
+#include <mutex>
+#include <thread>
+
+namespace {
+std::mutex m;
+std::condition_variable cv;
+bool listener_ready = false;
+int listener_port;
+} // namespace
+
+class test_recv : public proton::messaging_handler {
+  private:
+    class listener_ready_handler : public proton::listen_handler {
+        void on_open(proton::listener &l) PN_CPP_OVERRIDE {
+            {
+                std::lock_guard<std::mutex> lk(m);
+                listener_port = l.port();
+                listener_ready = true;
+            }
+            cv.notify_one();
+        }
+    };
+
+    std::string url;
+    proton::listener listener;
+    listener_ready_handler listen_handler;
+
+  public:
+    test_recv(const std::string &s) : url(s) {}
+
+    void on_container_start(proton::container &c) PN_CPP_OVERRIDE {
+        listener = c.listen(url, listen_handler);
+    }
+
+    void on_message(proton::delivery &d, proton::message &msg) PN_CPP_OVERRIDE 
{
+        d.receiver().close();
+        d.connection().close();
+        listener.stop();

Review comment:
       > No, I haven't used it. Will look into it.
   
   OK, let me give you a few pointers. If  you already use an IDE, you should 
use something built-in into it. If you use e.g. VS Code, there should be a 
debugger for C++ as a plugin. It is good to use a debugger in a program you 
already know how to use. Learning a new IDE at the same time makes things hard. 
What IDE/editor are you using for C++?
   
   Here's a tutorial for VS Code. Looking at it, I feel QT Creator was simpler 
;P https://www.youtube.com/watch?v=G9gnSGKYIg4
   
   When I had C++ at school, we used the free QT Creator IDE which was quite 
nice, or Clion is ok, if you have a Clion licence from your school (which we 
had). Another possibility is Eclipse for C/C++ which @ganeshmurthy is probably 
still using. I also used KDevelop at some point, and before it Anjuta.
   
   There is a command-line debugger GDB (and LLDB, which looks essentially the 
same). Pretty much all the other graphical debuggers are simply graphical front 
ends for GDB. I do not recommend using GDB directly when you have another 
option.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [cpp] An accessor for the delivery tag
> --------------------------------------
>
>                 Key: PROTON-2370
>                 URL: https://issues.apache.org/jira/browse/PROTON-2370
>             Project: Qpid Proton
>          Issue Type: Improvement
>          Components: cpp-binding
>            Reporter: Justin Ross
>            Assignee: Rakhi Kumari
>            Priority: Major
>             Fix For: proton-c-0.35.0
>
>
> *Assignee: Rakhi*
> Steps:
>  * Get familiar with the AMQP idea of a delivery tag
>  * Add a delivery tag accessor to the C++ delivery class
>  * Document the accessor in the C++ header
>  * Add a test for the accessor to the C++ test suite
> Resources:
>  * 
> [http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#doc-idp438000]
>  * 
> [http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#type-delivery-tag]
>  * 
> [https://github.com/apache/qpid-proton/blob/main/c/include/proton/delivery.h#L106]
>  * 
> [https://github.com/apache/qpid-proton/blob/main/cpp/include/proton/delivery.hpp]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to