From 489be34b462204071d81ba86644269e88e440bf5 Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期四, 30 九月 2021 13:31:15 +0800
Subject: [PATCH] fix SendReply free
---
test_socket/bus_test.cpp | 20 +-------------------
1 files changed, 1 insertions(+), 19 deletions(-)
diff --git a/test_socket/bus_test.cpp b/test_socket/bus_test.cpp
index b35e086..d2ead68 100644
--- a/test_socket/bus_test.cpp
+++ b/test_socket/bus_test.cpp
@@ -32,7 +32,6 @@
int rv;
ShmModSocket *sk = (ShmModSocket *)skptr;
-printf("run_recv\n");
struct timespec timeout = {2, 0};
while (true) {
printf("run_recv before\n");
@@ -51,20 +50,6 @@
}
-void *run_recv2(void *skptr) {
- pthread_detach(pthread_self());
- while(true) {
- logger->debug("================run_recv\n");
- // sleep(1);
- }
-}
-
-void client2(int key) {
- ShmModSocket *sk = new ShmModSocket();
- run_recv((void *)sk);
-}
-
-
void client(int key) {
ShmModSocket *sk = new ShmModSocket();
@@ -78,16 +63,13 @@
char content[512];
long i = 0;
-
pthread_create(&tid, NULL, run_recv, (void *)sk);
while (true) {
//printf("Usage: pub <topic> [content] or sub <topic>\n");
printf("Can I help you? sub, pub, desub or quit %d\n", i++);
- printf("client 1\n");
// scanf("%s", action);
std::cin >> action;
- printf("client 2\n");
if(strcmp(action, "sub") == 0) {
printf("Please input topic!\n");
scanf("%s", topic);
@@ -153,4 +135,4 @@
return 0;
-}
\ No newline at end of file
+}
--
Gitblit v1.8.0