[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet-nim] 55/61: Revert "try out nimbox"
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet-nim] 55/61: Revert "try out nimbox" |
Date: |
Sat, 13 Apr 2019 13:36:30 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnunet-nim.
commit 03c64300c78b085f7d115090e0f0ef54cace6cc6
Author: lurchi <address@hidden>
AuthorDate: Sun Aug 26 19:51:26 2018 +0200
Revert "try out nimbox"
This reverts commit 9bb383003464cbe6e0fe0abc2a9a060bbaf70be6.
---
examples/groupchat.nim | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/examples/groupchat.nim b/examples/groupchat.nim
index 7b3ac82..93d4323 100644
--- a/examples/groupchat.nim
+++ b/examples/groupchat.nim
@@ -1,5 +1,5 @@
import ../gnunet_application, ../asynccadet, ../gnunet_utils
-import asyncdispatch, asyncfile, parseopt, strutils, sequtils, times, os,
nimbox
+import asyncdispatch, asyncfile, parseopt, strutils, sequtils, times, os
type Chat = object
channels: seq[ref CadetChannel]
@@ -28,17 +28,10 @@ proc processServerMessages(channel: ref CadetChannel)
{.async.} =
return
echo getDateStr()," ",getClockStr()," ",message
-proc processInput(inputFile: AsyncFile, channel: ref CadetChannel, nb: NimBox)
{.async.} =
- var line = ""
+proc processInput(inputFile: AsyncFile, channel: ref CadetChannel) {.async.} =
while true:
- let ch = await inputFile.read(1)
- case ch
- of "\n":
- line = ""
- else:
- line.add(ch)
- nb.print(0, 11, line)
- nb.present()
+ let input = await inputFile.readline()
+ channel.sendMessage(input)
proc firstTask(gnunetApp: ref GnunetApplication,
server: string,
@@ -49,10 +42,8 @@ proc firstTask(gnunetApp: ref GnunetApplication,
if not server.isNil():
let inputFile = openAsync("/dev/stdin", fmRead)
let channel = cadet.createChannel(server, port)
- let nb = newNimbox()
- await processServerMessages(channel) or processInput(inputFile, channel,
nb)
+ await processServerMessages(channel) or processInput(inputFile, channel)
inputFile.close()
- nb.shutdown()
else:
let cadetPort = cadet.openPort(port)
while true:
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet-nim] 09/61: fix compilation, (continued)
- [GNUnet-SVN] [gnunet-nim] 09/61: fix compilation, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 60/61: Start of a nimble file, should probably drop nake later on., gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 49/61: added date and time string to output, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 10/61: fix compilation (2), gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 23/61: receiving of cadet messages possible now, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 51/61: Merge branch 'master' of ssh://gnunet.org/gnunet-nim, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 50/61: load config file in release mode too (fixes segfault), gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 36/61: use immutable variables where possible, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 33/61: add support for input and output file, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 54/61: try out nimbox, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 55/61: Revert "try out nimbox",
gnunet <=
- [GNUnet-SVN] [gnunet-nim] 57/61: Add nakefile, nim.cfg, and ignore more things, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 47/61: examples/{start, stop}_peers: Use /bin/sh, tested and checked against Bash and shellcheck., gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 61/61: nimble, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 42/61: add first version of groupchat application, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 41/61: move example applications / scripts / config files to example folder, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 59/61: gitignore, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 58/61: groupchat: improve CLI UX, gnunet, 2019/04/13