Hikaru
Hikaru

Reputation: 123

How do I know the status of chrome.experimental.socket?

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.

Upvotes: 2

Views: 181

Answers (2)

samthor
samthor

Reputation: 36

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.

Upvotes: 2

Mihai Parparita
Mihai Parparita

Reputation: 4236

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

Upvotes: 0

Related Questions