fix localhost socket only not working

if the pigpio daemon only listens to localhost sockets, the client failed to connect - this is the propesed fix by the author, see https://github.com/joan2937/pigpio/issues/119
This commit is contained in:
Daniel Plasa 2017-04-03 16:26:25 +02:00 committed by GitHub
parent 114653357b
commit 93dedc873c
1 changed files with 6 additions and 1 deletions

View File

@ -717,7 +717,12 @@ int pigpio_start(char *addrStr, char *portStr)
{
if (!gPiInUse[pi]) break;
}
if ((!addrStr) || (strlen(addrStr) == 0))
{
addrStr = "localhost";
}
if (pi >= MAX_PI) return pigif_too_many_pis;
gPiInUse[pi] = 1;