function connect(sockRef) {

    // grab the protocol, type, port and IP from
    // the sockRef passed in and use that
    // to create the socket
    if (SIMULATE) {
      callbacks.onConnected(1);
    } else {
      if (sockRef.protocol === "tcp") {
        chrome.sockets.tcp.create({}, function(createInfo) {
          sockRef.socket = createInfo.socketId;
          chrome.sockets.tcp.connect(sockRef.socket,
            DRONE_IP,
            sockRef.port,
            callbacks.onConnected);
        });
      } else if (sockRef.protocol === "udp") {
        chrome.sockets.udp.create({}, function(createInfo) {
          sockRef.socket = createInfo.socketId;
          chrome.sockets.udp.bind(sockRef.socket,
            CLIENT_IP, sockRef.port, callbacks.onConnected);
        });
      }
    }
  }
Creates and connects a socket connection

@see http://developer.chrome.com/apps/socket.html