Podcastindex-org/podping.cloud

convert hive-writer.py socket to ZeroMQ REQ/REP

daveajones opened this issue · 1 comments

@brianoflondon are you going to do this work on the python side? Once that side is done I'll convert the rust side over.

I can give it a go. I put in a very very simple socket thing earlier today for hive-watcher and got it working with an even simpler listening program.

I guess I can take a look at hive-writer again.

Try to explain a little bit better what you want it to do or should I just have it doing the same as now but with this zeroMQ library?

#----- A simple TCP based server program in Python using send() function -----



import socket



# Create a stream based socket(i.e, a TCP socket)

# operating on IPv4 addressing scheme

serverSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM);



# Bind and listen

serverSocket.bind(("127.0.0.1",8887));

serverSocket.listen();



# Accept connections

(clientConnected, clientAddress) = serverSocket.accept();

print("Accepted a connection request from %s:%s"%(clientAddress[0], clientAddress[1]));

while(True):

    dataFromClient = clientConnected.recv(1024)

    print(dataFromClient.decode());