[rkward/frameworks] rkward/rbackend: In MSVC stdout is not stdout... Fix startup handshake.

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Sat Feb 27 14:24:38 UTC 2016

Git commit f604aab777d2e6fab7c2d25b8ab541c244be7307 by Thomas Friedrichsmeier.
Committed on 27/02/2016 at 14:21.
Pushed by tfry into branch 'frameworks'.

In MSVC stdout is not stdout... Fix startup handshake.

M  +3    -3    rkward/rbackend/rkrbackendprotocol_backend.cpp


diff --git a/rkward/rbackend/rkrbackendprotocol_backend.cpp b/rkward/rbackend/rkrbackendprotocol_backend.cpp
index 0a59264..a1416eb 100644
--- a/rkward/rbackend/rkrbackendprotocol_backend.cpp
+++ b/rkward/rbackend/rkrbackendprotocol_backend.cpp
@@ -27,7 +27,7 @@
 #include <QLocalSocket>
 #include <QMutex>
 #include "rktransmitter.h"
-#include <stdio.h>
+#include <iostream>
 #include "rkbackendtransmitter.h"
 #include <QUuid>		// mis-used as a random-string generator
@@ -105,8 +105,8 @@
 		// a simple security token to send to the frontend to make sure that it is really talking to the backend process that it started in the local socket connection.
 		// this token is sent both via stdout and the local socket connection. The frontend simply compares both values.
 		QString token = QUuid::createUuid ().toString ();
-		printf ("%s\n", token.toLocal8Bit ().data ());
-		fflush (stdout);
+		std::cout << token.toLocal8Bit ().data () << "\n";
+		std::cout.flush ();
 		RKRBackendTransmitter transmitter (servername, token);
 		RKRBackendProtocolBackend backend (data_dir, rkd_server_name);

More information about the rkward-tracker mailing list