Показать сообщение отдельно
  #5 (permalink)  
Старый 17.09.2018, 13:00
Аватар для SuperZen
Профессор
Отправить личное сообщение для SuperZen Посмотреть профиль Найти все сообщения от SuperZen
 
Регистрация: 08.11.2017
Сообщений: 641

взял тут https://socket.io/docs/client-api/#n...er-url-options
<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Default value</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code>path</code></td>
      <td><code>/socket.io</code></td>
      <td>name of the path that is captured on the server side</td>
    </tr>
    <tr>
      <td><code>reconnection</code></td>
      <td><code>true</code></td>
      <td>whether to reconnect automatically</td>
    </tr>
    <tr>
      <td><code>reconnectionAttempts</code></td>
      <td><code>Infinity</code></td>
      <td>number of reconnection attempts before giving up</td>
    </tr>
    <tr>
      <td><code>reconnectionDelay</code></td>
      <td><code>1000</code></td>
      <td>how long to initially wait before attempting a new reconnection (<code>1000</code>). Affected by +/- <code>randomizationFactor</code>,
        for example the default initial delay will be between 500 to 1500ms.</td>
    </tr>
    <tr>
      <td><code>reconnectionDelayMax</code></td>
      <td><code>5000</code></td>
      <td>maximum amount of time to wait between reconnections (<code>5000</code>). Each attempt increases the reconnection
        delay by 2x along with a randomization as above</td>
    </tr>
    <tr>
      <td><code>randomizationFactor</code></td>
      <td><code>0.5</code></td>
      <td>0 &lt;= randomizationFactor &lt;= 1</td>
    </tr>
    <tr>
      <td><code>timeout</code></td>
      <td><code>20000</code></td>
      <td>connection timeout before a <code>connect_error</code> and <code>connect_timeout</code> events are emitted</td>
    </tr>
    <tr>
      <td><code>autoConnect</code></td>
      <td><code>true</code></td>
      <td>by setting this false, you have to call <code>manager.open</code> whenever you decide it’s appropriate</td>
    </tr>
    <tr>
      <td><code>query</code></td>
      <td><code>{}</code></td>
      <td>additional query parameters that are sent when connecting a namespace (then found in <code>socket.handshake.query</code>        object
        on the server-side)</td>
    </tr>
  </tbody>
</table>


Each attempt increases the reconnection delay by 2x along with a randomization as above
Ответить с цитированием