Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COFrom a bandwidth perspective the first option is almost certainly better. That way only the backup server(s) are polling the primary server. Will your primary server be out of sync once it comes back up? If so it may need to talk to the backup before it restores service anyway. If not then are your servers basically stateless? If so why do you have a primary and a backup...they are just peers. In that case you should be trying to keep clients distributed between them for load reasons and to ease the strain when one fails.
      singulars
    2. CO@JeremyFriesner I will try second approach, what I think is that I will try to connect to the main server before I send message to the back up server. Also can you elaborate more on blocking I/O that I have, I'm not really familiar with that. Thanks
      singulars
    3. CO@swiftk sockets are created in blocking mode by default, which means that if they can't send/recv data at the moment send()/recv() is called, then the send()/recv() call will not return until there is some data sent/received (i.e. possibly not for a long time). If you'd rather have those calls never block (i.e. so your thread can do something else while you are waiting for the socket to become ready to send/recv), then you can set the socket to non-blocking mode after you create it, via fcntl(fd, F_SETFL, O_NONBLOCK); or under Windows it's unsigned long m=1; ioctlsocket(fd, FIONBIO, &m);
      singulars
 

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