SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict ketting00's Avatar
    Join Date
    Jul 2011
    Posts
    310
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    What does this 'buffer' do in this function

    In my Google search I find this function:
    Code:
    var InputSource = function(stream) {
    	var buffers = [];
    	.
    	.
    	.
    	if (this.ws) { // only have websocket set
    		binary.pack({
    			ch_num:buffers.length,
    			buffer_length:BUFFER_LENGTH,
    			buffer_array:buffers
    		}, function(buffer) {
    			this.ws.send(buffer);
    		});
    	}
    };
    I wonder what does this 'buffer' mean or what it does?

    There is a global declaration var buffer = [[], []]; outside the function.

    The code is three hundred lines long but this is the part which I want.

    Thanks

    Note: I don't use their code. I want to create my own code but I don't know what does this mean.

  2. #2
    SitePoint Addict ketting00's Avatar
    Join Date
    Jul 2011
    Posts
    310
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Never Mind. Despite not understand this, I got the result I want.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •