christgau / wsdd

A Web Service Discovery host daemon.
MIT License
861 stars 101 forks source link

Execution of the `list` command hangs #125

Closed Izorkin closed 2 years ago

Izorkin commented 2 years ago

The command execution hangs:

echo list | sudo nc -U /run/wsdd/wsdd.sock
16a65700-007c-1000-...    DESKTOP-...       2021-12-07T...     [FE80::1...]%eth0,192.168....%eth0
061763a0-ddb8-4c80-...    DESKTOP-...       2021-12-07T...     [FE80::2...]%eth0
.
^C
Time: 0h:03m:49s

wsdd version 0.7.0. The error appears after this commit - https://github.com/christgau/wsdd/commit/c77644260a0cd4f2d7b931d869218d9c20f79689

christgau commented 2 years ago

This is not an error but expected behavior. As of 3867e82 (released with v0.7.0), the connections to the API socket are not closed after each command which was the case in the previous version. Instead, they are kept open. That is why netcat does not do anything further. For (BSD) netcat, you can use the -N option to shutdown the connection after STDIN has been read.