function disconnect(sockRef) {
    if (!SIMULATE) {
      if (sockRef.protocol === "tcp") {
        chrome.sockets.tcp.disconnect(sockRef.socket, function(result) {
          chrome.sockets.tcp.close(sockRef.socket, noop);
          sockRef.socket = null;
        });
      } else if (sockRef.protocol === "udp") {
        chrome.sockets.udp.close(sockRef.socket, noop);
        sockRef.socket = null;
      }
    }
  }
Disconnects and destroys the socket connection