While I was reproducing example in Daemon example I found that after command echo " abc-example| a b c" | netcat localhost 26542 the result printed out and hands until I Ctrl+C.
I tryed to do in python:
class VWClient:
def __init__(self, vwhost, vwport):
self._host = vwhost
self._port = vwport
def request(self, message: str) -> bytes:
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((self._host, self._port))
print('Socket connected to', self._host, 'on port', self._port)
s.sendall(message.encode() + b'\n')
response = s.recv(1024)
return response
This happens in python code after I send message and trying to recv. It just hands on line response = self._socket.recv(1024)
What I'm doing wrong?