I’m trying to write my own protocol so that multiple servers can pass data and connect with each other, kind of like mongo://. I have been looking at TCP & I understand ports, but how do I write something so that people can just do something like connect(“proto://example.com:6767/”) ?
Also, I’m writing in python.
Thanks!
I believe you need to look into
urllib2and writing a subclass ofBaseHandler, specifically the functionsprotocol_requestandprotocol_response.Whether the way urllib2 handles request/response cycles suits your application is up to you to decide — it may or may not be exactly what you want.