gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet-nim] branch master updated (04b1430 -> 4b7a974)


From: gnunet
Subject: [GNUnet-SVN] [gnunet-nim] branch master updated (04b1430 -> 4b7a974)
Date: Sun, 29 Jul 2018 20:02:08 +0200

This is an automated email from the git hooks/post-receive script.

lurchi pushed a change to branch master
in repository gnunet-nim.

    from 04b1430  make the cleanup proc the finalizer (no explicit call 
necessary anymore)
     new cd73042  make the cleanup proc the finalizer (no explicit call 
necessary anymore)
     new 4b7a974  let's try out ports and channels

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 asynccadet.nim | 1 +
 gnunet_nim.nim | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/asynccadet.nim b/asynccadet.nim
index 171382a..1d4366a 100644
--- a/asynccadet.nim
+++ b/asynccadet.nim
@@ -100,6 +100,7 @@ proc openPort*(handle: var CadetHandle, port: string): ref 
CadetPort =
 
 proc closePort*(handle: var CadetHandle, port: ref CadetPort) =
   GNUNET_CADET_close_port(port.handle)
+  port.channels.complete()
   handle.openPorts.delete(handle.openPorts.find(port))
 
 proc createChannel*(handle: CadetHandle, peer: string, port: string): 
CadetChannel =
diff --git a/gnunet_nim.nim b/gnunet_nim.nim
index d141f85..65cf0a6 100644
--- a/gnunet_nim.nim
+++ b/gnunet_nim.nim
@@ -6,6 +6,13 @@ proc firstTask(gnunetApp: ref GnunetApplication) {.async.} =
   echo "connecting Cadet"
   var cadet = await gnunetApp.connectCadet()
   echo "connected"
+  let port = cadet.openPort("test")
+  let (finished, channel) = await port.channels.read()
+  if not finished:
+    echo "incoming connection!"
+    let (finished, message) = await channel.messages.read()
+    if not finished:
+      echo "got message: ", message
   cadet.disconnect()
   echo "disconnected"
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]