Fixing typos in the Network Communication help article
Review URL: https://codereview.chromium.org/618053002
Cr-Commit-Position: refs/heads/master@{#304047}
diff --git a/chrome/common/extensions/docs/templates/articles/app_network.html b/chrome/common/extensions/docs/templates/articles/app_network.html
index 9b9aba36..a0f0273 100644
--- a/chrome/common/extensions/docs/templates/articles/app_network.html
+++ b/chrome/common/extensions/docs/templates/articles/app_network.html
@@ -230,7 +230,7 @@
<pre>
function listenAndAccept(socketId) {
- chrome.sockets.tcp.listen(socketId,
+ chrome.sockets.tcpServer.listen(socketId,
IP, PORT, function(resultCode) {
onListenCallback(socketId, resultCode)
});
@@ -275,8 +275,12 @@
console.log("Data sent to new TCP client connection.")
});
// Start receiving data.
- chrome.sockets.tcp.onReceive(info.clientSocketId, onReceive);
- chrome.sockets.tco.setPaused(false);
+ chrome.sockets.tcp.onReceive.addListener(function(recvInfo) {
+ if (recvInfo.socketId != info.clientSocketId)
+ return;
+ // recvInfo.data is an arrayBuffer.
+ });
+ chrome.sockets.tcp.setPaused(false);
}
</pre>