Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

0.1.1

Compare
Choose a tag to compare
Loading
@dgrahamdgraham released this 13 Jul 18:16
v0.1.1
This tag was signed with the committer’sverified signature.
dgraham David Graham
GPG key ID:AA9405DCE2E0D208
Verified
Learn about vigilant mode.

StableSocket

A web socket that reconnects.

Installation

$ npm install @github/stable-socket

Usage

import{StableSocket}from'@github/stable-socket'constdelegate={socketDidOpen(socket:Socket){// Socket is ready to write.socket.send('Hello')},socketDidClose(socket:Socket,code?:number,reason?:string){// Socket closed and will retry the connection.},socketDidFinish(socket:Socket){// Socket closed for good and will not retry.},socketDidReceiveMessage(socket:Socket,message:string){// Socket read data from the connection.}}constpolicy={timeout:4000,attempts:Infinity,maxDelay:60000}constsocket=newStableSocket('wss://live.example.com',delegate,policy)socket.open()
Assets2
Loading

[8]ページ先頭

©2009-2025 Movatter.jp