MOD aaa-12 优化rpc socket创建路径
SOL 优化rpc socket创建路径 修改人:zhangliang 检视人:zhangliang
This commit is contained in:
parent
000acf4b49
commit
815e56d529
|
@ -106,15 +106,19 @@ void rpc_worker_start(rpc_worker_thread *th) {
|
||||||
pthread_create(&pid, NULL, thread_worker_handler, 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)
|
boolean rpc_unix_sockets_get(int port, int *psfd)
|
||||||
{
|
{
|
||||||
struct sockaddr_un serun;
|
struct sockaddr_un serun;
|
||||||
int listenfd, size;
|
int listenfd, size;
|
||||||
char *socket_path = CONFIGM_UNIX_SOCKET;
|
char socket_path[32];
|
||||||
|
//char *socket_path = CONFIGM_UNIX_SOCKET;
|
||||||
int flag = 1;
|
int flag = 1;
|
||||||
|
|
||||||
|
memset(socket_path, 0, 32);
|
||||||
|
snprintf(socket_path, 32, "%d.socket", port);
|
||||||
|
|
||||||
if ((listenfd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
|
if ((listenfd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
|
||||||
{
|
{
|
||||||
rpc_log_error("socket error");
|
rpc_log_error("socket error");
|
||||||
|
|
Loading…
Reference in New Issue