wangzhengquan
2021-03-13 a38304f7f6b91aaa1b0aa76cc9d3e5b6aef1f85f
src/socket/shm_socket.cpp
@@ -112,12 +112,9 @@
static int _shm_socket_close_(shm_socket_t *sockt) {
  
  int rv;
  int rv, i;
  logger->debug("shm_socket_close\n");
  // hashtable_remove(hashtable, mkey);
  // if(sockt->queue != NULL) {
  //   sockt->queue = NULL;
  // }
  if(sockt->key != 0) {
    auto it =  shmQueueStMap->find(sockt->key);
@@ -127,6 +124,24 @@
    }
  }
  printf("====sockt->queue addr = %p\n", sockt->queue);
  if(sockt->queue != NULL) {
    for( i = 0; i < sockt->queue->size(); i++) {
      mm_free((*(sockt->queue))[i].buf);
      logger->info("======= %d free queue element buf\n", sockt->key);
    }
    // hashtable_remove(hashtable, mkey);
  //   sockt->queue = NULL;
  }
  // hashtable_remove(hashtable, mkey);
  // if(sockt->queue != NULL) {
  //   sockt->queue = NULL;
  // }
 
  pthread_mutex_destroy(&(sockt->mutex) );
@@ -168,8 +183,6 @@
int shm_socket_get_key(shm_socket_t *sockt){
  return sockt->key;
}
// 短连接方式发送
int shm_sendto(shm_socket_t *sockt, const void *buf, const int size,