aboutsummaryrefslogtreecommitdiffstats
path: root/ccnxandroidmetis
diff options
context:
space:
mode:
authorAngelo Mantellini (manangel) <angelo.mantellini@irt-systemx.fr>2017-04-08 00:57:33 +0200
committerAngelo Mantellini (manangel) <angelo.mantellini@irt-systemx.fr>2017-04-08 00:57:33 +0200
commit20d003a4858d18ccd0b22496c5ad926d3a51601f (patch)
treea5c3e02e184eb0f4ce852a6a4928a6046118a4c6 /ccnxandroidmetis
parent3137acdd5a45285dab9903f9d41560c63eca8523 (diff)
correct scripts and makefile, little correction in switch off of metis
Change-Id: Icfce254c22af4b7363ec206f5f9703520113f0ee Signed-off-by: Angelo Mantellini (manangel) <angelo.mantellini@irt-systemx.fr>
Diffstat (limited to 'ccnxandroidmetis')
-rw-r--r--ccnxandroidmetis/ccnxsupportlibrary/src/main/jni/ccnxsupportlibrary/Metis_wrap.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/ccnxandroidmetis/ccnxsupportlibrary/src/main/jni/ccnxsupportlibrary/Metis_wrap.c b/ccnxandroidmetis/ccnxsupportlibrary/src/main/jni/ccnxsupportlibrary/Metis_wrap.c
index 2febb40f..c23d48aa 100644
--- a/ccnxandroidmetis/ccnxsupportlibrary/src/main/jni/ccnxsupportlibrary/Metis_wrap.c
+++ b/ccnxandroidmetis/ccnxsupportlibrary/src/main/jni/ccnxsupportlibrary/Metis_wrap.c
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <getopt.h>
@@ -92,21 +92,14 @@ JNIEXPORT void JNICALL Java_com_metis_ccnx_ccnxsupportlibrary_Metis_start
metisConfiguration_SetObjectStoreSize(configuration, 0);
metisConfiguration_StartCLI(configuration, 2001);
if (path != NULL) {
- __android_log_print(ANDROID_LOG_DEBUG, "Metis Wrap","qui");
const char *configFileName = (*env)->GetStringUTFChars(env, path, 0);
- __android_log_print(ANDROID_LOG_DEBUG, "Metis Wrap", "configuration file %s", configFileName);
metisForwarder_SetupFromConfigFile(metis, configFileName);
- __android_log_print(ANDROID_LOG_DEBUG, "Metis Wrap","config from file");
} else {
- __android_log_print(ANDROID_LOG_DEBUG, "Metis Wrap","qua");
metisForwarder_SetupAllListeners(metis, PORT_NUMBER, NULL);
}
MetisDispatcher *dispatcher = metisForwarder_GetDispatcher(metis);
- __android_log_print(ANDROID_LOG_DEBUG, "Metis Wrap","dispatcher");
_isRunning = true;
- __android_log_print(ANDROID_LOG_DEBUG, "Metis Wrap","true");
metisDispatcher_Run(dispatcher);
- __android_log_print(ANDROID_LOG_DEBUG, "Metis Wrap","run");
}
}
@@ -117,6 +110,9 @@ JNIEXPORT void JNICALL Java_com_metis_ccnx_ccnxsupportlibrary_Metis_stop
if(_isRunning) {
__android_log_print(ANDROID_LOG_DEBUG, "Metis Wrap", "%s", "stopping metis...");
metisForwarder_Destroy(&metis);
+ metisDispatcher_Stop(metisForwarder_GetDispatcher(metis));
+ sleep(1);
+ metisForwarder_Destroy(&metis);
_isRunning = false;
}
}