最終更新:2017-09-16 (土) 21:02:22 (2414d)  

io.Socket
Top / io.Socket

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

Client

  • const socket = io('http://localhost');
    var socket = io("http://localhost:3000/").connect();

メソッド

イベント

  • connectFired upon a connection including a successful reconnection.
    connect_errorFired upon a connection error.
    connect_timeoutFired upon a connection timeout.
    errorFired when an error occurs.
    diconnectFired upon a disconnection.
    reconnectFired upon a successful reconnection.
    reconnect_attemptFired upon an attempt to reconnect.
    reconnectingFired upon an attempt to reconnect.
    reconnect_errorFired upon a reconnection attempt error.
    reconnect_failedFired when couldn't reconnect within reconnectionAttempts.
    pingFired when a ping packet is written out to the server.
    pongFired when a pong is received from the server.