python - Which protocol should I use for pyzmq? -


i working on project have client server model in python. set server monitor requests , send data. pyzmq supports: tcp, udp, pgm, epgm, inproc , ipc. have been using tcp interprocess communication, have no idea should use sending request on internet server. need put in:

    socket.bind(bind_address) 

diagram: client communicating on internet server running program

any particular reason you're not using ipc or inproc interprocess communication?

other that, generally, can consider tcp universal communicator; it's not best choice, no matter (so long have ip address) work.

here's need know when making choice between transports:

  1. pgm/epgm multicast transports - idea send 1 message , gets delivered single message until last possible moment broken multiple messages, 1 each receiver. unless absolutely know need this, don't need this.
  2. ipc/inproc interprocess communication... if you're communicating between different threads in same process, or different processes on same logical host, these might appropriate. benefit of little less overhead. if might ever add new logical hosts, not appropriate.
  3. russle borogove enumerates difference between tcp , udp well. typically you'll want use tcp. if absolute speed more important reliability you'll use udp.

it understanding udp wasn't supported zmq, if it's there it's added pyzmq binding.

also, took @ diagram - probably want server zmq socket bind , client zmq socket connect... there reasons why might reverse this, general rule server considered "reliable" peer, , client "transient" peer, , want "reliable" peer bind, "transient" peer connect.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -