Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>OPTION 1: The general cost of creating a TCP connection are:</strong></p> <ol> <li>Create socket connection</li> <li>Send data</li> <li>Tear down socket connection</li> </ol> <p>Step 1: Requires an exchange of packets, so it's delayed by to &amp; from network latency plus the destination server's service time. No significant CPU usage on either box is involved. </p> <p>Step 2: Depends on the size of the message.</p> <p>Step 3: IIRC, just sends a 'closing now' packet, w/ no wait for destination ack, so no latency involved.</p> <p><strong>OPTION 2: Costs of UDP:*</strong></p> <ol> <li>Create UDP object</li> <li>Send data</li> <li>Close UDP object</li> </ol> <p>Step 1: Requires minimal setup, no latency worries, very fast.</p> <p>Step 2: BE CAREFUL OF SIZE, there is no retransmit in UDP since it doesn't care if the packet was received by anyone or not. I've heard that the larger the message, the greater probability of data being received corrupted, and that a rule of thumb is that you'll lose a certain percentage of messages over 20 MB. </p> <p>Step 3: Minimal work, minimal time.</p> <p><strong>OPTION 3: Use ZeroMQ Instead</strong></p> <p>You're comparing TCP to UDP with a goal of reducing reconnection time. THERE IS A NICE COMPROMISE: ZeroMQ sockets. </p> <p>ZMQ allows you to set up a publishing socket where you don't care if anyone is listening (like UDP), and have multiple listeners on that socket. This is NOT a UDP socket - it's an alternative to both of these protocols. </p> <p>See: <a href="http://www.zeromq.org/" rel="noreferrer">ZeroMQ.org</a> for details. </p> <p>It's very high speed and fault tolerant, and is in increasing use in the financial industry for those reasons.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload