/// <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(); }
public override void Close() { CheckNotDisposed(); transport.Close(); }
private void DestoryInstance(TTransport instance) { if (instance.IsOpen) { instance.Close(); } instance.Flush(); instance.Dispose(); }
/// <summary> /// 归还对象时校验对象 /// </summary> private void ValidateOnReturn(TTransport instance) { if (instance.IsOpen) { instance.Close(); } }
/// <summary> /// Close Connection /// </summary> /// <param name="transport">Exists Connect</param> public static void TransportClose(ref TTransport transport) { transport.Flush(); transport.Close(); }