Package net.solosky.maplefetion.util

Examples of net.solosky.maplefetion.util.SliceSipcResponseHelper


  {
    //-_-!!! , 好吧,我承认这里判断逻辑有点乱。。
    if (o instanceof SipcResponse) {
      SipcResponse response = (SipcResponse) o;
      //先检查这个回复是不是分块回复的一部分
      SliceSipcResponseHelper helper = this.findSliceResponseHelper(response);
      if(helper!=null){
        //如果是分块回复,就添加到分块回复列表中
        helper.addSliceSipcResponse(response);
        if(helper.isFullSipcResponseRecived()){
          synchronized (slicedResponseQueue) {
            slicedResponseQueue.remove(helper);
          }
         
          //构造新的回复
          SipcResponse some = helper.getFullSipcResponse();
          this.handleFullResponse(some);
         
          return some;  //返回新的完整的请求
        }else{
          return null//分块回复还没接收完,返回null停止处理链
        }
      }else if(response.getStatusCode()==SipcStatus.PARTIAL){  //可能是第一次收到的分块回复
        helper = new SliceSipcResponseHelper(response);
        synchronized (slicedResponseQueue) {
          slicedResponseQueue.add(helper);
        }
        return null;    //第一个分块回复,返回null停止处理链
      }else//不是分块回复的对象就直接进行下一步操作
View Full Code Here


  {
    synchronized(this.slicedResponseQueue) {
      Iterator<SliceSipcResponseHelper> it = this.slicedResponseQueue.iterator();
        int resCallID = response.getCallID();
        String resSequence = response.getSequence();
        SliceSipcResponseHelper helper = null;
       
        while (it.hasNext()) {
          helper = it.next();
          if (helper.getCallid()==resCallID && helper.getSequence().equals(resSequence)) {
            return helper;
          }
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of net.solosky.maplefetion.util.SliceSipcResponseHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.