/// <summary>
 /// 推送比对记录
 /// </summary>
 /// <param name="info"></param>
 /// <param name="IP"></param>
 /// <returns></returns>
 public int UpdateCmp(RealtimeCmpInfo info, string IP)
 {
     try
     {
         // 生成socket套接字;
         Thrift.Transport.TSocket tsocket = new Thrift.Transport.TSocket(IP, 6000);
         //设置连接超时为100;
         tsocket.Timeout = 3000;
         //生成客户端对象
         Thrift.Transport.TTransport transport             = tsocket;
         Thrift.Protocol.TProtocol   protocol              = new Thrift.Protocol.TBinaryProtocol(transport);
         UIServer.Client             _BusinessServerClient = new UIServer.Client(protocol);
         transport.Open();
         _BusinessServerClient.UpdateRealtimeCmp(info, "##@" + info.Channel);
         transport.Close();
         return(0);
     }
     catch (Exception ex)
     {
         _WriteLog.WriteToLog("UpdateCmp", ex);
         return(-1);
     }
 }
 public override void Close()
 {
     transport.Close();
 }
示例#3
0
 public override void Close()
 {
     CheckNotDisposed();
     transport.Close();
 }
 private void DestoryInstance(TTransport instance)
 {
     if (instance.IsOpen)
     {
         instance.Close();
     }
     instance.Flush();
     instance.Dispose();
 }
示例#5
0
 /// <summary>
 /// 归还对象时校验对象
 /// </summary>
 private void ValidateOnReturn(TTransport instance)
 {
     if (instance.IsOpen)
     {
         instance.Close();
     }
 }
示例#6
0
 /// <summary>
 /// Close Connection
 /// </summary>
 /// <param name="transport">Exists Connect</param>
 public static void TransportClose(ref TTransport transport)
 {
     transport.Flush();
     transport.Close();
 }