最終更新:2018-10-23 (火) 16:01:45 (335d)  

Socket.IO/クライアント はてなブックマークを見る
Top / Socket.IO / クライアント

https://socket.io/docs/client-api/

https://github.com/socketio/socket.io-client

<script src="/socket.io/socket.io.js"></script>

exports

  • exports.protocol?
  • exports.connect? -> lookup?([url][, options])
  • exports.Manager? =
  • exports.Socket?

io

  • io.connect = lookup([url][, options])
    • defaults to trying to connect to the host that serves the page.
    • if (null == uri) uri = loc.protocol + '//' + loc.host;

socket

Socket.IO/クラス

再接続

  • new Manager(url[, options])
    reconnectiontruewhether to reconnect automatically
    reconnectionAttemptsInfinitynumber of reconnection attempts before giving up
    reconnectionDelay1000how long to initially wait before attempting a new reconnection (1000). Affected by +/- randomizationFactor, for example the default initial delay will be between 500 to 1500ms.
    reconnectionDelayMax?5000maximum amount of time to wait between reconnections (5000). Each attempt increases the reconnection delay by 2x along with a randomization as above
    randomizationFactor0.50 <= randomizationFactor <= 1
    autoConnecttrueby setting this false, you have to call manager.open whenever you decide it’s appropriate

バインディング