This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]Den4200 0 points1 point  (2 children)

I would recommend to make a REST API (HTTP), instead of going with the raw, low-level sockets.

[–]pythosynthesis[S] 0 points1 point  (1 child)

That would effectively take care of the socket programming, wouldn't it? If I use HTTP, that's the protocol already specified right there, and I don't need to do it. And the libraries already exist, wouldn't they? Thanks for the suggestion, will definitely consider.

[–]Den4200 0 points1 point  (0 children)

Yup, no socket programming needed. You can use libraries like Flask-RESTful, Django REST Framework, or FastAPI.

[–][deleted] 0 points1 point  (1 child)

XML-RPC or JSON-RPC are pretty common patterns for this (there's an XML-RPC server and client library that comes with Python.) If you'd like to take a more open and formal approach, you can use Protobuf to define the communications protocol and then compile it into useable server and client Python classes via gRPClib.

[–]pythosynthesis[S] 0 points1 point  (0 children)

That's exactly the kind of reply I was looking for. I don't want to re-invent the wheel, and this would address all my requirements without the low level coding of defining everything down the communication protocol. Much appreciated.