MOD aaa-12 优化rpc socket创建路径

SOL  优化rpc socket创建路径
修改人:zhangliang
检视人:zhangliang
This commit is contained in:
zhanglianghy 2019-07-11 11:47:53 +08:00
parent 000acf4b49
commit 815e56d529
1 changed files with 6 additions and 2 deletions

View File

@ -106,15 +106,19 @@ void rpc_worker_start(rpc_worker_thread *th) {
pthread_create(&pid, NULL, thread_worker_handler, th);
}
#define CONFIGM_UNIX_SOCKET "configm.socket"
//#define CONFIGM_UNIX_SOCKET "configm.socket"
boolean rpc_unix_sockets_get(int port, int *psfd)
{
struct sockaddr_un serun;
int listenfd, size;
char *socket_path = CONFIGM_UNIX_SOCKET;
char socket_path[32];
//char *socket_path = CONFIGM_UNIX_SOCKET;
int flag = 1;
memset(socket_path, 0, 32);
snprintf(socket_path, 32, "%d.socket", port);
if ((listenfd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
{
rpc_log_error("socket error");