]> git.wh0rd.org - chrome-ext/music-player-client.git/blobdiff - js/tcp-client.js
images: update screenshot
[chrome-ext/music-player-client.git] / js / tcp-client.js
index 8d1db93eb9d12a74ac7ae9223dcecde2f81ccc7c..ed3b598126db85ed7b51d930337771921bc58fe1 100644 (file)
@@ -49,7 +49,7 @@ Author: Boris Smus (smus@chromium.org)
   /**
    * Connects to the TCP socket, and creates an open socket.
    *
   /**
    * Connects to the TCP socket, and creates an open socket.
    *
-   * @see http://developer.chrome.com/trunk/apps/socket.html#method-create
+   * @see http://developer.chrome.com/apps/socket.html#method-create
    * @param {Function} callback The function to call on connection
    */
   TcpClient.prototype.connect = function(callback) {
    * @param {Function} callback The function to call on connection
    */
   TcpClient.prototype.connect = function(callback) {
@@ -62,7 +62,7 @@ Author: Boris Smus (smus@chromium.org)
   /**
    * Sends a message down the wire to the remote side
    *
   /**
    * Sends a message down the wire to the remote side
    *
-   * @see http://developer.chrome.com/trunk/apps/socket.html#method-write
+   * @see http://developer.chrome.com/apps/socket.html#method-write
    * @param {String} msg The message to send
    * @param {Function} callback The function to call when the message has sent
    */
    * @param {String} msg The message to send
    * @param {Function} callback The function to call when the message has sent
    */
@@ -88,7 +88,7 @@ Author: Boris Smus (smus@chromium.org)
   /**
    * Disconnects from the remote side
    *
   /**
    * Disconnects from the remote side
    *
-   * @see http://developer.chrome.com/trunk/apps/socket.html#method-disconnect
+   * @see http://developer.chrome.com/apps/socket.html#method-disconnect
    */
   TcpClient.prototype.disconnect = function() {
     socket.disconnect(this.socketId);
    */
   TcpClient.prototype.disconnect = function() {
     socket.disconnect(this.socketId);
@@ -101,7 +101,7 @@ Author: Boris Smus (smus@chromium.org)
    * we go ahead and connect to the remote side.
    *
    * @private
    * we go ahead and connect to the remote side.
    *
    * @private
-   * @see http://developer.chrome.com/trunk/apps/socket.html#method-connect
+   * @see http://developer.chrome.com/apps/socket.html#method-connect
    * @param {Object} createInfo The socket details
    */
   TcpClient.prototype._onCreate = function(createInfo) {
    * @param {Object} createInfo The socket details
    */
   TcpClient.prototype._onCreate = function(createInfo) {
@@ -124,7 +124,7 @@ Author: Boris Smus (smus@chromium.org)
    */
   TcpClient.prototype._onConnectComplete = function(resultCode) {
     // Start polling for reads.
    */
   TcpClient.prototype._onConnectComplete = function(resultCode) {
     // Start polling for reads.
-    setInterval(this._periodicallyRead.bind(this), 500);
+    setInterval(this.poll.bind(this), 500);
 
     if (this.callbacks.connect) {
       log('connect complete');
 
     if (this.callbacks.connect) {
       log('connect complete');
@@ -136,9 +136,9 @@ Author: Boris Smus (smus@chromium.org)
   /**
    * Checks for new data to read from the socket
    *
   /**
    * Checks for new data to read from the socket
    *
-   * @see http://developer.chrome.com/trunk/apps/socket.html#method-read
+   * @see http://developer.chrome.com/apps/socket.html#method-read
    */
    */
-  TcpClient.prototype._periodicallyRead = function() {
+  TcpClient.prototype.poll = function() {
     socket.read(this.socketId, null, this._onDataRead.bind(this));
   };
 
     socket.read(this.socketId, null, this._onDataRead.bind(this));
   };