fix - Can't connect to server on retry due to config.path is modified in retry loop on win32 env

This commit is contained in:
Gloridea 2015-12-01 04:53:06 +09:00
parent 021b191af5
commit b37f4dac42

View file

@ -48,13 +48,14 @@ function connect(){
if(!client.port){ if(!client.port){
client.log('Connecting client on Unix Socket :'.debug, client.path.variable); client.log('Connecting client on Unix Socket :'.debug, client.path.variable);
if (process.platform ==='win32' && !client.path.startsWith('\\\\.\\pipe\\')){ if (process.platform ==='win32' && !client.path.startsWith('\\\\.\\pipe\\')){
client.path = client.path.replace(/^\//, ''); var path = client.path;
client.path = client.path.replace(/\//g, '-'); path = path.replace(/^\//, '');
client.path= '\\\\.\\pipe\\'+client.path; path = path.replace(/\//g, '-');
path= '\\\\.\\pipe\\'+path;
} }
client.socket = net.connect( client.socket = net.connect(
{ {
path:client.path path: path
} }
); );
}else{ }else{