ssl上的连接超时

时间:2016-08-02 13:35:16

标签: ssl ssl-certificate connection-timeout

我有一个客户端应用程序,通过https连接到远程服务器用于商业目的。此连接使用旧IO(阻塞连接)。它通常运行顺畅。

最近我克隆了客户端,从而创建了一个新的客户端实例,从同一个盒子运行并使用相同的客户端证书。我注意到服务器有很多连接超时。我想知道克隆是否会以某种方式导致超时,以及是否存在ssl问题。

两个实例都会收到以下系统参数以确保安全性:

var element = $("#cards_stream").children(":first");
var elementIdToSelect = element.attr('id');

targetElement = document.getElementById(elementIdToSelect);

var touchStartCoords =  {'x':-1, 'y':-1}, // X and Y coordinates on mousedown or touchstart events.
    touchEndCoords = {'x':-1, 'y':-1},// X and Y coordinates on mouseup or touchend events.
    direction = 'undefined',// Swipe direction
    minDistanceXAxis = 30,// Min distance on mousemove or touchmove on the X axis
    maxDistanceYAxis = 30,// Max distance on mousemove or touchmove on the Y axis
    maxAllowedTime = 1000,// Max allowed time between swipeStart and swipeEnd
    startTime = 0,// Time on swipeStart
    elapsedTime = 0,// Elapsed time between swipeStart and swipeEnd
    targetElement = document.getElementById(elementIdToSelect);// Element to delegate

function swipeStart(e) {
  e = e ? e : window.event;
  e = ('changedTouches' in e)?e.changedTouches[0] : e;
  touchStartCoords = {'x':e.pageX, 'y':e.pageY};
  startTime = new Date().getTime();
}

function swipeEnd(e) {
  e = e ? e : window.event;
  e = ('changedTouches' in e)?e.changedTouches[0] : e;
  touchEndCoords = {'x':e.pageX - touchStartCoords.x, 'y':e.pageY - touchStartCoords.y};
  elapsedTime = new Date().getTime() - startTime;
  if (elapsedTime <= maxAllowedTime){
    if (Math.abs(touchEndCoords.x) >= minDistanceXAxis && Math.abs(touchEndCoords.y) <= maxDistanceYAxis){
      direction = (touchEndCoords.x < 0)? 'left' : 'right';
      switch(direction){
        case 'left':
          targetElement.textContent = "Left swipe detected";
          break;
        case 'right':
          targetElement.textContent = "Right swipe detected";
          break;
      }

    }
  }
}

function addMultipleListeners(el, s, fn) {
  var evts = s.split(' ');
  for (var i=0, iLen=evts.length; i<iLen; i++) {
    el.addEventListener(evts[i], fn, false);
  }
}

addMultipleListeners(targetElement, 'mousedown touchstart', swipeStart);
addMultipleListeners(targetElement, 'mouseup touchend', swipeEnd);

不幸的是,服务器端的支持非常有限。我希望这个论坛中有人能提出一个想法。

0 个答案:

没有答案