wangzhengquan
2020-12-24 dbf7fd6f620b86c382431ce10fd5fe3c5ddca955
update
5个文件已修改
25 ■■■■■ 已修改文件
src/bus_error.c 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/bus_error.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/socket/shm_mod_socket.c 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/socket/shm_socket.c 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
test_net_socket/test_net_mod_socket.c 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/bus_error.c
@@ -14,7 +14,8 @@
static char *_bus_errlist[_bus_nerr] = {
  "\0",
  "timeout",
  "the other end is not inline"
  "The other end is not inline",
  "Key already in use"
};
src/bus_error.h
@@ -7,6 +7,7 @@
#define EBUS_TIMEOUT 1
#define EBUS_CLOSED 2
#define EBUS_KEY_INUSED 3
extern int bus_errno;
src/socket/shm_mod_socket.c
@@ -15,7 +15,7 @@
}
ShmModSocket::~ShmModSocket() {
  logger->debug("Destory ShmModSocket...\n");
  // logger->debug("Close ShmModSocket...\n");
    struct timespec timeout = {1, 0};
    if(bus_set != NULL) {
        for(auto bus_iter = bus_set->begin(); bus_iter != bus_set->end(); bus_iter++) {
@@ -25,7 +25,6 @@
    }
    shm_close_socket(shm_socket);
// printf("ShmModSocket  destory 4\n");
}
int ShmModSocket::bind(int key) {
src/socket/shm_socket.c
@@ -30,7 +30,8 @@
static inline int  _shm_socket_check_key(shm_socket_t *socket) {
   void *tmp_ptr = mm_get_by_key(socket->key);
    if (tmp_ptr!= NULL && tmp_ptr != (void *)1 && !socket->force_bind ) {
      logger->error("key %d has already been in used!", socket->key);
      bus_errno = EBUS_KEY_INUSED;
      logger->error("%s. key = %d ", bus_strerror(bus_errno), socket->key);
      return 0;
    }
    return 1;
@@ -112,7 +113,8 @@
  } else {
   if(!_shm_socket_check_key(socket)) {
     return -1;
     bus_errno = EBUS_KEY_INUSED;
     return EBUS_KEY_INUSED;
   }
  }
@@ -202,7 +204,8 @@
    socket->key = hashtable_alloc_key(hashtable);
  } else {
    if(!_shm_socket_check_key(socket)) {
      return -1;
      bus_errno = EBUS_KEY_INUSED;
      return EBUS_KEY_INUSED;
    }
  }
@@ -308,7 +311,8 @@
    } else {
     if(!_shm_socket_check_key(socket)) {
        return -1;
        bus_errno = EBUS_KEY_INUSED;
        return EBUS_KEY_INUSED;
     }
    }
@@ -382,7 +386,8 @@
    } else {
      if(!_shm_socket_check_key(socket)) {
        return -1;
        bus_errno = EBUS_KEY_INUSED;
        return EBUS_KEY_INUSED;
      }
    }
test_net_socket/test_net_mod_socket.c
@@ -141,7 +141,6 @@
    sprintf(sendbuf, "RECEIVED  PORT %d NAME %s", remote_port, recvbuf);
    net_mod_socket_sendto(client, sendbuf, strlen(sendbuf) + 1, remote_port);
    free(recvbuf);
    sleep(1000);
  }
}
@@ -286,7 +285,7 @@
void test_net_sendandrecv_threads(char *nodelist) {
  int status, i = 0, processors = 4;
  int status, i = 0, processors = 1;
  void *res[processors];
  // Targ *targs = (Targ *)calloc(processors, sizeof(Targ));
  Targ targs[processors];