Pregunta

When I use "chrome.experimental.socket API" on chrome-extension, how do I know the socket had been disconnected or, is disconnected just now. I'm use Canary-Chrome.

¿Fue útil?

Solución

I've just made a change which adds a getInfo call to the socket API, which includes the connected/disconnected state.

However it's worth noting that a socket may remain 'connected' even if say, the remote end has dropped the connection; after this kind of drop, a read() will return an error/EOF.

Otros consejos

Getting the state of a socket is currently not possible with the API. I have filed a Chromium feature request for this.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top