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){
client.log('Connecting client on Unix Socket :'.debug, client.path.variable);
if (process.platform ==='win32' && !client.path.startsWith('\\\\.\\pipe\\')){
client.path = client.path.replace(/^\//, '');
client.path = client.path.replace(/\//g, '-');
client.path= '\\\\.\\pipe\\'+client.path;
var path = client.path;
path = path.replace(/^\//, '');
path = path.replace(/\//g, '-');
path= '\\\\.\\pipe\\'+path;
}
client.socket = net.connect(
{
path:client.path
path: path
}
);
}else{